akismet_add_comment_nonce

Definition:
function akismet_add_comment_nonce( $post_id ) {}

Parameters

  • $post_id

Source code

function akismet_add_comment_nonce( $post_id ) {

	echo '<p style="display: none;">';

	wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );

	echo '</p>';

}

8995

add_screen_option

Definition:
function add_screen_option( $option, $args = array() {}

Register and configure an admin screen option

Parameters

  • string $option: An option name.
  • mixed $args: Option dependent arguments

Source code

function add_screen_option( $option, $args = array() ) {

	global $wp_current_screen_options;



	if ( !isset($wp_current_screen_options) )

		$wp_current_screen_options = array();



	$wp_current_screen_options[$option] = $args;

}

8971

add_menu_classes

Definition:
function add_menu_classes($menu) {}

Parameters

  • $menu

Defined filters

  • add_menu_classes
    apply_filters( 'add_menu_classes', $menu )

Source code

function add_menu_classes($menu) {



	$first = $lastorder = false;

	$i = 0;

	$mc = count($menu);

	foreach ( $menu as $order => $top ) {

		$i++;



		if ( 0 == $order ) { // dashboard is always shown/single

			$menu[0][4] = add_cssclass('menu-top-first', $top[4]);

			$lastorder = 0;

			continue;

		}



		if ( 0 === strpos($top[2], 'separator') ) { // if separator

			$first = true;

			$c = $menu[$lastorder][4];

			$menu[$lastorder][4] = add_cssclass('menu-top-last', $c);

			continue;

		}



		if ( $first ) {

			$c = $menu[$order][4];

			$menu[$order][4] = add_cssclass('menu-top-first', $c);

			$first = false;

		}



		if ( $mc == $i ) { // last item

			$c = $menu[$order][4];

			$menu[$order][4] = add_cssclass('menu-top-last', $c);

		}



		$lastorder = $order;

	}



	return apply_filters( 'add_menu_classes', $menu );

}

8947

add_cssclass

Definition:
function add_cssclass($add, $class) {}

Build Administration Menu.

Parameters

  • $add
  • $class

Source code

function add_cssclass($add, $class) {

	$class = empty($class) ? $add : $class .= ' ' . $add;

	return $class;

}

8931

WordPress Syntax mode for Panic Coda

As I’m working in Coda all day and I’m usually working with WordPress code, I took a moment and parsed our WordPress docs and created a WordPress syntax file for Coda.

PHP-HTML-WP mode

The mode is based on the PHP-HTML mode that comes with Coda 1.7 and WordPress 3.3.

Requirements:

Tested on Coda 1.7, might work on previous versions.

Installation:

  1. Download the packed mode file and unpack it.
  2. Copy the PHP-HTML-WP.mode the Coda Modes folder. ~/Library/Application Support/Coda/Modes/
  3. Open a WordPress or PHP file and load the syntax mode in Coda by visiting Text -> Syntax Mode -> PHP-HTML-WP in the toolbar.
  4. Optional: To make this mode the default visit the Editor pane in the Preferences window and select the ‘PHP-HTML-WP’ mode as default file type

Please note that this is an early version and is most likely still buggy. If you encounter any issues don’t hesitate to leave us a note.