Ploption $key

[edit] Please Note

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

Filter

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

Parameters

$key

  • key - string - The Option Key

$args

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

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 );
}

Change Log

Since 2.2

Source Files

Related