ID,'layout',true);
$disable_acommerce_title = get_post_meta( $post->ID,'disable_acommerce_title',true);
// We'll use this nonce field later on when saving.
wp_nonce_field( 'layout_nonce', 'meta_box_nonce' );
//Image layout
$acommerce_right_sidebar = ACOMMERCE_THEME_URI . 'assets/images/sidebar/right-sidebar.png';
$acommerce_left_sidebar = ACOMMERCE_THEME_URI . 'assets/images/sidebar/left-sidebar.png';
$acommerce_no_sidebar = ACOMMERCE_THEME_URI . 'assets/images/sidebar/full-width.png';
$acommerce_both_sidebar = ACOMMERCE_THEME_URI . 'assets/images/sidebar/both-sidebar.png';
?>
>
>
>
>
array( // on allow a tags
'href' => array() // and those anchors can only have href attribute
)
);
if ( isset( $_POST['layout'] ) ) {
$layout = sanitize_text_field( wp_unslash( $_POST['layout'] ) ); // ...
}
if( $layout ){
update_post_meta( $news_id, 'layout', esc_attr( $layout ));
}
}
}
new aCommerce_Sidebar_Layout();
/**
* aCommerce get layout
*/
if ( ! function_exists( 'acommerce_get_sidebar_layout' ) ) {
function acommerce_get_sidebar_layout() {
global $post;
$acommerce_layout = get_theme_mod( 'acommerce_archiver_sierbar_layout', 'acommerce-right-sidebar' );
// Front page displays in Reading Settings
$acommerce_page_for_posts = get_option('page_for_posts');
// Get Layout meta
if($post) {
$post_specific_layout = get_post_meta( $post->ID, 'layout', true );
}
// Home page if Posts page is assigned
if( is_home() && !( is_front_page() ) ) {
$queried_id = get_theme_mod( 'acommerce_archiver_sierbar_layout', 'acommerce-right-sidebar' );
if( !empty($post_specific_layout) && $post_specific_layout != 'default-layout' ) {
$acommerce_layout = get_post_meta( $post->ID, 'layout', true );
}
}
elseif( is_page() ) {
$acommerce_layout = get_theme_mod('acommerce_page_sierbar_layout','acommerce-right-sidebar');
if( !empty($post_specific_layout) && $post_specific_layout != 'default-layout' ) {
$acommerce_layout = get_post_meta( $post->ID, 'layout', true );
}
}
elseif( is_single() ) {
$acommerce_layout = get_theme_mod('acommerce_single_page_sierbar_layout','acommerce-right-sidebar');
if( !empty($post_specific_layout) && $post_specific_layout != 'default-layout' ) {
$acommerce_layout = get_post_meta( $post->ID, 'layout', true );
}
}
return $acommerce_layout;
}
}