Last active
June 18, 2022 10:36
-
-
Save Codevz/5d7b9654203923925be715510a961ffb to your computer and use it in GitHub Desktop.
XTRA WP Theme modify a page meta option value via custom WordPress filter, https://xtratheme.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* With this function you can modify any options value for specific page or post. | |
* | |
* @var $meta saved page/post settings | |
* @var $post_id current page/post ID | |
* | |
* @return array | |
*/ | |
function codevz_page_meta( $meta, $post_id ) { | |
// On specific page only. | |
if ( $post_id === '21' ) { | |
$meta[ 'layout' ] = 'left'; | |
} | |
return $meta; | |
} | |
add_filter( 'codevz/page/meta', 'codevz_page_meta', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/