Ploption $key

[edit] Please Note

These docs are now deprecated, we have a new Support area located here

(Difference between revisions)
(Related)
 
Line 1: Line 1:
 +
__NOTOC__
 
== Filter ==
 
== Filter ==
 
 
<tt>ploption_{$key}</tt> is a filter applied to the ploption function. Used to override the db setting.
 
<tt>ploption_{$key}</tt> is a filter applied to the ploption function. Used to override the db setting.
  

Latest revision as of 19:03, 26 March 2012

[edit] Filter

ploption_{$key} is a filter applied to the ploption function. Used to override the db setting.

[edit] Parameters

$key

  • key - string - The Option Key

$args

  • post_id - int - Post/Page ID'
  • subkey -
  • clone_id - int - Clone ID
  • setting -

[edit] Examples

Override the header image on all pages:

add_filter ('ploption_pagelines_custom_logo', 'change_header_img', 10,2 );

function change_header_img( $key, $args) {
	
	return 'http://www.url.to.my_header.png';
}

Override the header image on specific post/page

add_filter ('ploption_pagelines_custom_logo', 'change_header_img', 10, 2 );

function change_header_img( $key, $args) {

	if ( '2' == $args['post_id'] )
		return 'http://www.url.to.my_header.png';
	
	return get_ploption( $key, $args );
}

[edit] Change Log

Since 2.2

[edit] Source Files

[edit] Related