: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
defined( 'ABSPATH' ) || exit;
* Add Page Options for selective themes, only in Builder plugin version
* @package Themify_Builder
* @subpackage Themify_Builder/classes
class Themify_Builder_Builder_Page_Options {
if ( is_file( THEMIFY_BUILDER_DIR . '/theme-compat/' . get_template() . '.css' ) ) {
add_theme_support( 'themify-page-options' );
add_filter( 'themify_metabox/fields/themify-meta-boxes', [ __CLASS__, 'metaboxes' ], 10, 2 );
add_filter( 'body_class', [ __CLASS__, 'body_class' ] );
add_filter( 'themify_builder_fullwidth_layout_support', [ __CLASS__, 'themify_builder_fullwidth_layout_support' ] );
add_filter( 'template_include', [ __CLASS__, 'template_include' ] );
add_action( 'wp_footer', [ __CLASS__, 'wp_footer' ], 18 );
static function metaboxes( $meta_boxes = array(), $post_type = 'all' ) {
return array_merge( array(
'name' => __( 'Page Options', 'themify' ),
'id' => 'builder-plugin-page-options',
'options' => self::options(),
static function options() {
'name' => '_tb_template',
'title' => __( 'Header/Footer', 'themify' ),
[ 'value' => '', 'name' => __( 'Default', 'themify' ) ],
[ 'value' => 'blank', 'name' => __( 'No header/footer', 'themify' ) ],
'hide' => 'blank tb_template_none',
if ( current_theme_supports( 'themify-page-options' ) ) {
'name' => 'content_width',
'title' => __('Content Width', 'themify'),
'value' => 'default_width',
'img' => THEMIFY_URI . '/img/default.svg',
'title' => __('Default', 'themify')
'img' => THEMIFY_URI . '/img/fullwidth.svg',
'title' => __('Fullwidth', 'themify')
'default' => 'default_width',
'class' => 'tb_template_none',
'name' => 'hide_post_title',
'title' => __('Hide Title', 'themify'),
array('value' => 'default', 'name' => '', 'selected' => true),
array('value' => 'yes', 'name' => __('Yes', 'themify')),
'class' => 'tb_template_none',
static function body_class( $classes ) {
if ( themify_get( 'content_width' ) === 'full_width' ) {
$classes[] = 'tb_fullwidth';
if ( themify_get( 'hide_post_title' ) === 'yes' ) {
$classes[] = 'tb_hide_title';
* Disable the fullwidthRows.js if page is fullwidth (this is handled by CSS)
static function themify_builder_fullwidth_layout_support( $support ) {
if ( is_page() && themify_get( 'content_width' ) === 'full_width' ) {
static function template_include( $template ) {
if ( is_page() && themify_get( '_tb_template' ) === 'blank' ) {
$template = THEMIFY_BUILDER_DIR . '/plugin/tpl/page-template-blank.php';
static function wp_footer() {
if ( current_theme_supports( 'themify-page-options' ) ) {
$template = get_template();
themify_enque_style( "tb_{$template}", THEMIFY_BUILDER_URI . '/theme-compat/' . $template . '.css', null, THEMIFY_VERSION );
add_action( 'init', [ 'Themify_Builder_Builder_Page_Options', 'init' ] );