Ploption $key

[edit] Please Note

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

(Difference between revisions)
(Created page with "== Description == <code>ploption_{$key}</code> is a filter applied to the ploption function. Used to override the db setting. == Parameters == {{Parameter|$key|string|The O...")
 
(Parameters)
Line 4: Line 4:
  
 
== Parameters ==
 
== Parameters ==
 
+
'''$key'''
{{Parameter|$key|string|The Option Key}}
+
* key - ''string - The Option Key''
{{Parameter|$args|array|Contains optional data (post_id,subkey,clone_id,setting}}
+
'''$args'''
 +
* post_id - ''int - Post/Page ID'
 +
* subkey -
 +
* clone_id - ''int - Clone ID''
 +
* setting -
  
 
== Examples ==
 
== Examples ==

Revision as of 23:43, 15 March 2012

Contents

Description

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_page_background_image_url', '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

Source Files

Related