modification to add per page widgets to custom post types
-
if you edit the main plugin file i123_per_page_widgets.php line 196
Change the function i123_widgets_custom_fields_add() as below and the widgets chooser will show up in your custom post types as well.
[ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]
function i123_widgets_custom_fields_add() { i123_widgets_admin_init(); add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', 'post', 'side', 'high' ); add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', 'page', 'side', 'high' ); $args=array( 'public' => true, '_builtin' => false ); $operator = "and"; //'and or 'or' $output = "names"; //names or objects - names is default $post_types = get_post_types($args,$output,$operator); foreach($post_types as $post_type) { add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', $post_type, 'side', 'high' ); } }
https://www.ads-software.com/extend/plugins/per-page-widgets/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘modification to add per page widgets to custom post types’ is closed to new replies.