get_categories

Definition:
function &get_categories( $args = '' ) {}

Retrieve list of category objects.
If you change the type to ‘link’ in the arguments, then the link categories will be returned instead. Also all categories will be updated to be backwards compatible with pre-2.3 plugins and themes.

Parameters

  • string|array $args: Optional. Change the defaults retrieving categories.

Return values

returns:List of categories.

Defined filters

  • get_categories_taxonomy
    apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args )

Source code

function &get_categories( $args = '' ) {

	$defaults = array( 'taxonomy' => 'category' );

	$args = wp_parse_args( $args, $defaults );



	$taxonomy = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );



	// Back compat

	if ( isset($args['type']) && 'link' == $args['type'] ) {

		_deprecated_argument( __FUNCTION__, '3.0', '' );

		$taxonomy = $args['taxonomy'] = 'link_category';

	}



	$categories = (array) get_terms( $taxonomy, $args );



	foreach ( array_keys( $categories ) as $k )

		_make_cat_compat( $categories[$k] );



	return $categories;

}

1240

get_cancel_comment_reply_link

Definition:
function get_cancel_comment_reply_link($text = '') {}

Retrieve HTML content for cancel comment reply link.

Parameters

  • string $text: Optional. Text to display for cancel reply link.

Defined filters

  • cancel_comment_reply_link
    apply_filters('cancel_comment_reply_link', '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>', $link, $text)

Source code

function get_cancel_comment_reply_link($text = '') {

	if ( empty($text) )

		$text = __('Click here to cancel reply.');



	$style = isset($_GET['replytocom']) ? '' : ' style="display:none;"';

	$link = esc_html( remove_query_arg('replytocom') ) . '#respond';

	return apply_filters('cancel_comment_reply_link', '<a rel="nofollow" id="cancel-comment-reply-link" href="' . $link . '"' . $style . '>' . $text . '</a>', $link, $text);

}

1238

get_calendar

Definition:
function get_calendar($initial = true, $echo = true) {}

Display calendar with days that have posts as links.
The calendar is cached, which will be retrieved, if it exists. If there are no posts for the month, then it will not be displayed.

Parameters

  • bool $initial: Optional, default is true. Use initial calendar names.
  • bool $echo: Optional, default is true. Set to false for return.

Defined filters

  • get_calendar
    apply_filters( 'get_calendar', $cache[$key] )
  • get_calendar
    apply_filters( 'get_calendar', $cache[$key] )

Source code

function get_calendar($initial = true, $echo = true) {

	global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;



	$cache = array();

	$key = md5( $m . $monthnum . $year );

	if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) {

		if ( is_array($cache) && isset( $cache[ $key ] ) ) {

			if ( $echo ) {

				echo apply_filters( 'get_calendar',  $cache[$key] );

				return;

			} else {

				return apply_filters( 'get_calendar',  $cache[$key] );

			}

		}

	}



	if ( !is_array($cache) )

		$cache = array();



	// Quick check. If we have no posts at all, abort!

	if ( !$posts ) {

		$gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");

		if ( !$gotsome ) {

			$cache[ $key ] = '';

			wp_cache_set( 'get_calendar', $cache, 'calendar' );

			return;

		}

	}



	if ( isset($_GET['w']) )

		$w = ''.intval($_GET['w']);



	// week_begins = 0 stands for Sunday

	$week_begins = intval(get_option('start_of_week'));



	// Let's figure out when we are

	if ( !empty($monthnum) && !empty($year) ) {

		$thismonth = ''.zeroise(intval($monthnum), 2);

		$thisyear = ''.intval($year);

	} elseif ( !empty($w) ) {

		// We need to get the month from MySQL

		$thisyear = ''.intval(substr($m, 0, 4));

		$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's

		$thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");

	} elseif ( !empty($m) ) {

1236

get_broken_themes

Definition:
function get_broken_themes() {}

Source code

function get_broken_themes() {

	global $wp_broken_themes;



	get_themes();

	return $wp_broken_themes;

}

1234

get_boundary_post_rel_link

Definition:
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {}

Get boundary post relational link.
Can either be start or end post relational link.

Parameters

  • string $title: Optional. Link title format.
  • bool $in_same_cat: Optional. Whether link should be in same category.
  • string $excluded_categories: Optional. Excluded categories IDs.
  • bool $start: Optional, default is true. Whether display link to first or last post.

Defined filters

  • the_title
    apply_filters('the_title', $title, $post->ID)
  • {$boundary}_post_rel_link
    apply_filters( "{$boundary}_post_rel_link", $link )

Source code

function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {

	$posts = get_boundary_post($in_same_cat, $excluded_categories, $start);

	// If there is no post stop.

	if ( empty($posts) )

		return;



	// Even though we limited get_posts to return only 1 item it still returns an array of objects.

	$post = $posts[0];



	if ( empty($post->post_title) )

		$post->post_title = $start ? __('First Post') : __('Last Post');



	$date = mysql2date(get_option('date_format'), $post->post_date);



	$title = str_replace('%title', $post->post_title, $title);

	$title = str_replace('%date', $date, $title);

	$title = apply_filters('the_title', $title, $post->ID);



	$link = $start ? "<link rel='start' title='" : "<link rel='end' title='";

	$link .= esc_attr($title);

	$link .= "' href='" . get_permalink($post) . "' />\n";



	$boundary = $start ? 'start' : 'end';

	return apply_filters( "{$boundary}_post_rel_link", $link );

1232