link_submit_meta_box

Definition:
function link_submit_meta_box($link) {}

Display link create form fields.

Parameters

  • object $link

Defined actions

  • post_submitbox_start
    do_action('post_submitbox_start');
  • submitlink_box
    do_action('submitlink_box');

Source code

function link_submit_meta_box($link) {

?>

<div class="submitbox" id="submitlink">



<div id="minor-publishing">



<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>

<div style="display:none;">

<?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>

</div>



<div id="minor-publishing-actions">

<div id="preview-action">

<?php if ( !empty($link->link_id) ) { ?>

	<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>

<?php } ?>

</div>

<div class="clear"></div>

</div>



<div id="misc-publishing-actions">

<div class="misc-pub-section misc-pub-section-last">

	<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>

</div>

</div>



</div>



<div id="major-publishing-actions">

<?php do_action('post_submitbox_start'); ?>

<div id="delete-action">

<?php

if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>

	<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n  'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>

<?php } ?>

</div>



<div id="publishing-action">

<?php if ( !empty($link->link_id) ) { ?>

	<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />

<?php } else { ?>

	<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />

<?php } ?>

</div>

<div class="clear"></div>

</div>

<?php do_action('submitlink_box'); ?>

<div class="clear"></div>

</div>

<?php

}

2259

link_pages

Definition:
function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',

Print list of pages based on arguments.

Parameters

  • string $before
  • string $after
  • string $next_or_number
  • string $nextpagelink
  • string $previouspagelink
  • string $pagelink
  • string $more_file

Source code

function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page',

					$pagelink='%', $more_file='') {

	_deprecated_function( __FUNCTION__, '2.1', 'wp_link_pages()' );



	$args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file');

	return wp_link_pages($args);

}

2257

link_cat_row

Definition:
function link_cat_row( $category, $name_override = false ) {}

Parameters

  • unknown_type $category
  • unknown_type $name_override

Defined filters

  • link_cat_row_actions
    apply_filters('link_cat_row_actions', $actions, $category)
  • editable_slug
    apply_filters('editable_slug', $qe_data->slug)
  • editable_slug
    apply_filters('editable_slug', $category->slug)
  • manage_link_categories_custom_column
    apply_filters('manage_link_categories_custom_column', '', $column_name, $category->term_id)

Source code

function link_cat_row( $category, $name_override = false ) {

	static $row_class = '';



	if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )

		return false;

	if ( is_wp_error( $category ) )

		return $category;



	$default_cat_id = (int) get_option( 'default_link_category' );

	$name = ( $name_override ? $name_override : $category->name );

	$edit_link = "link-category.php?action=edit&amp;cat_ID=$category->term_id";

	if ( current_user_can( 'manage_categories' ) ) {

		$edit = "<a class='row-title' href='$edit_link' title='" . esc_attr(sprintf(__('Edit “%s”'), $category->name)) . "'>$name</a><br />";

		$actions = array();

		$actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';

		$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';

		if ( $default_cat_id != $category->term_id )

			$actions['delete'] = "<a class='delete:the-list:link-cat-$category->term_id submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&amp;cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "'>" . __('Delete') . "</a>";

		$actions = apply_filters('link_cat_row_actions', $actions, $category);

		$action_count = count($actions);

		$i = 0;

		$edit .= '<div class="row-actions">';

		foreach ( $actions as $action => $link ) {

			++$i;

			( $i == $action_count ) ? $sep = '' : $sep = ' | ';

			$edit .= "<span class='$action'>$link$sep</span>";

		}

		$edit .= '</div>';

	} else {

		$edit = $name;

	}



	$row_class = 'alternate' == $row_class ? '' : 'alternate';

	$qe_data = get_term_to_edit($category->term_id, 'link_category');



	$category->count = number_format_i18n( $category->count );

	$count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count;

	$output = "<tr id='link-cat-$category->term_id' class='iedit $row_class'>";

	$columns = get_column_headers('edit-link-categories');

	$hidden = get_hidden_columns('edit-link-categories');

	foreach ( $columns as $column_name => $column_display_name ) {

		$class = "class=\"$column_name column-$column_name\"";



		$style = '';

		if ( in_array($column_name, $hidden) )

			$style = ' style="display:none;"';



		$attributes = "$class$style";



		switch ($column_name) {

			case 'cb':

				$output .= "<th scope='row' class='check-column'>";

				if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {

					$output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";

				} else {

					$output .= "&nbsp;";

				}

				$output .= "</th>";

				break;

			case 'name':

				$output .= "<td $attributes>$edit";

				$output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';

				$output .= '<div class="name">' . $qe_data->name . '</div>';

				$output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';

				$output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';

				break;

			case 'description':

				$output .= "<td $attributes>$category->description</td>";

				break;

			case 'slug':

				$output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";

				break;

			case 'links':

				$attributes = 'class="links column-links num"' . $style;

				$output .= "<td $attributes>$count</td>";

				break;

			default:

				$output .= "<td $attributes>";

				$output .= apply_filters('manage_link_categories_custom_column', '', $column_name, $category->term_id);

				$output .= "</td>";

		}

	}

	$output .= '</tr>';



	return $output;

}

2255

link_categories_meta_box

Definition:
function link_categories_meta_box($link) { ?>

Display link categories form fields.

Parameters

  • object $link

Source code

function link_categories_meta_box($link) { ?>

<ul id="category-tabs" class="category-tabs">

	<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>

	<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>

</ul>



<div id="categories-all" class="tabs-panel">

	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">

		<?php

		if ( isset($link->link_id) )

			wp_link_category_checklist($link->link_id);

		else

			wp_link_category_checklist();

		?>

	</ul>

</div>



<div id="categories-pop" class="tabs-panel" style="display: none;">

	<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">

		<?php wp_popular_terms_checklist('link_category'); ?>

	</ul>

</div>



<div id="category-adder" class="wp-hidden-children">

	<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>

	<p id="link-category-add" class="wp-hidden-child">

		<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>

		<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />

		<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php esc_attr_e( 'Add' ); ?>" />

		<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>

		<span id="category-ajax-response"></span>

	</p>

</div>

<?php

}

2253

link_advanced_meta_box

Definition:
function link_advanced_meta_box($link) {}

Display advanced link options form fields.

Parameters

  • object $link

Source code

function link_advanced_meta_box($link) {

?>

<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">

	<tr class="form-field">

		<th valign="top"  scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>

		<td><input type="text" name="link_image" class="code" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" style="width: 95%" /></td>

	</tr>

	<tr class="form-field">

		<th valign="top"  scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>

		<td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo  ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" size="50" style="width: 95%" /></td>

	</tr>

	<tr class="form-field">

		<th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>

		<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>

	</tr>

	<tr class="form-field">

		<th valign="top"  scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>

		<td><select name="link_rating" id="link_rating" size="1">

		<?php

			for ($r = 0; $r <= 10; $r++) {

				echo('            <option value="'. esc_attr($r) .'" ');

				if ( isset($link->link_rating) && $link->link_rating == $r)

					echo 'selected="selected"';

				echo('>'.$r.'</option>');

			}

		?></select>&nbsp;<?php _e('(Leave at 0 for no rating.)') ?>

		</td>

	</tr>

</table>

<?php

}

2251