(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''' | |
| − | + | * key - ''string - The Option Key'' | |
| − | + | '''$args''' | |
| + | * post_id - ''int - Post/Page ID' | ||
| + | * subkey - | ||
| + | * clone_id - ''int - Clone ID'' | ||
| + | * setting - | ||
== Examples == | == Examples == | ||
Contents |
ploption_{$key} is a filter applied to the ploption function. Used to override the db setting.
$key
$args
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 );
}