Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function berman_setup_custom_acf_page_types( $berman ) {
- $page_types = array(
- 'page_for_product_categories' => __('Page For Product Categories', 'Global Pages post-states', 'berman'),
- 'page_for_404' => __('Page For 404', 'Global Pages post-states', 'berman'),
- );
- new Layer\Custom_ACF_Page_Type($page_types);
- $suffix_page_id = '_id';
- $suffix_permalink = '_permalink';
- foreach ( $page_types as $page_type => $page_type_label ) {
- $page_id_variable = ${$page_type . $suffix_page_id};
- $page_id = get_field($page_type, 'options');
- $berman->{$page_id_variable} = (int)$page_id;
- $berman->${$page_type . $suffix_permalink} = get_the_permalink( $page_id );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement