edit_comment

Definition:
function edit_comment() {}

Update a comment with values provided in $_POST.

Source code

function edit_comment() {



	if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )

		wp_die ( __( 'You are not allowed to edit comments on this post.' ) );



	$_POST['comment_author'] = $_POST['newcomment_author'];

	$_POST['comment_author_email'] = $_POST['newcomment_author_email'];

	$_POST['comment_author_url'] = $_POST['newcomment_author_url'];

	$_POST['comment_approved'] = $_POST['comment_status'];

	$_POST['comment_content'] = $_POST['content'];

	$_POST['comment_ID'] = (int) $_POST['comment_ID'];



	foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {

		if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {

			$_POST['edit_date'] = '1';

			break;

		}

	}



	if ( !empty ( $_POST['edit_date'] ) ) {

		$aa = $_POST['aa'];

		$mm = $_POST['mm'];

		$jj = $_POST['jj'];

		$hh = $_POST['hh'];

		$mn = $_POST['mn'];

		$ss = $_POST['ss'];

		$jj = ($jj > 31 ) ? 31 : $jj;

		$hh = ($hh > 23 ) ? $hh -24 : $hh;

		$mn = ($mn > 59 ) ? $mn -60 : $mn;

		$ss = ($ss > 59 ) ? $ss -60 : $ss;

		$_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";

	}



	wp_update_comment( $_POST );

}

996

edit_bookmark_link

Definition:
function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {}

Display edit bookmark (literally a URL external to blog) link anchor content.

Parameters

  • string $link: Optional. Anchor text.
  • string $before: Optional. Display before edit link.
  • string $after: Optional. Display after edit link.
  • int $bookmark: Optional. Bookmark ID.

Defined filters

  • edit_bookmark_link
    apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id )

Source code

function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {

	$bookmark = get_bookmark($bookmark);



	if ( !current_user_can('manage_links') )

		return;



	if ( empty($link) )

		$link = __('Edit This');



	$link = '<a href="' . get_edit_bookmark_link( $bookmark ) . '" title="' . esc_attr__( 'Edit Link' ) . '">' . $link . '</a>';

	echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;

}

994

dynamic_sidebar

Definition:
function dynamic_sidebar($index = 1) {}

Display dynamic sidebar.
By default it displays the default sidebar or ‘sidebar-1’. The ‘sidebar-1’ is not named by the theme, the actual name is ‘1’, but ‘sidebar-‘ is added to the registered sidebars for the name. If you named your sidebar ‘after-post’, then the parameter $index will still be ‘after-post’, but the lookup will be for ‘sidebar-after-post’.

Parameters

  • int|string $index: Optional, default is 1. Name or ID of dynamic sidebar.

Return values

returns:True, if widget sidebar was found and called. False if not found or not called.

Defined filters

  • dynamic_sidebar_params
    apply_filters( 'dynamic_sidebar_params', $params )

Defined actions

  • dynamic_sidebar
    do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );

Source code

function dynamic_sidebar($index = 1) {

	global $wp_registered_sidebars, $wp_registered_widgets;



	if ( is_int($index) ) {

		$index = "sidebar-$index";

	} else {

		$index = sanitize_title($index);

		foreach ( (array) $wp_registered_sidebars as $key => $value ) {

			if ( sanitize_title($value['name']) == $index ) {

				$index = $key;

				break;

			}

		}

	}



	$sidebars_widgets = wp_get_sidebars_widgets();

	if ( empty( $sidebars_widgets ) )

		return false;



	if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )

		return false;



	$sidebar = $wp_registered_sidebars[$index];



	$did_one = false;

	foreach ( (array) $sidebars_widgets[$index] as $id ) {



		if ( !isset($wp_registered_widgets[$id]) ) continue;



		$params = array_merge(

			array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ),

			(array) $wp_registered_widgets[$id]['params']

		);



		// Substitute HTML id and class attributes into before_widget

		$classname_ = '';

		foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) {

			if ( is_string($cn) )

				$classname_ .= '_' . $cn;

			elseif ( is_object($cn) )

				$classname_ .= '_' . get_class($cn);

		}

		$classname_ = ltrim($classname_, '_');

		$params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_);



		$params = apply_filters( 'dynamic_sidebar_params', $params );



		$callback = $wp_registered_widgets[$id]['callback'];



		do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );



		if ( is_callable($callback) ) {

			call_user_func_array($callback, $params);

			$did_one = true;

		}

	}



	return $did_one;

}

992

drop_index

Definition:
function drop_index($table, $index) {}

Parameters

  • string $table: Database table name.
  • string $index: Index name to drop.

Return values

returns:True, when finished.

Source code

function drop_index($table, $index) {

	global $wpdb;

	$wpdb->hide_errors();

	$wpdb->query("ALTER TABLE `$table` DROP INDEX `$index`");

	// Now we need to take out all the extra ones we may have created

	for ($i = 0; $i < 25; $i++) {

		$wpdb->query("ALTER TABLE `$table` DROP INDEX `{$index}_$i`");

	}

990

dropdown_link_categories

Definition:
function dropdown_link_categories( $default = 0 ) {}

Parameters

  • unknown_type $default

Source code

function dropdown_link_categories( $default = 0 ) {

	_deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' );

	global $link_id;

	wp_link_category_checklist( $link_id );

}

988