[Plugin: Flickr Shortcode Importer] Support for custom post types
-
The plugin only supports short codes on the Post and Page post types. These days themes often come with other post types which need to be processed (I’m using one which has “portfolio” post types which are precisely where the [flickr] codes are going to be.
Below are the edits which add options to the Post Options tab of settings and extend the plugin functions to operate on any of the selected post types.
first the code for the settings page
[ Code edited and moderator note: please use backticks or the code button when posting small code snippets of 10 lines or less. ]
$posttypes = (array) get_post_types( array('public'=>TRUE), 'objects' ); foreach($posttypes AS $ptype=>$ptype_obj) { $this->settings['ptype_enable_post_widget_'.$ptype] = array( 'section' => 'posts', 'title' => __( 'Process shortcodes on' , 'flickr-shortcode-importer'), 'desc' => __( $ptype_obj->labels->name.' type of post.' , 'flickr-shortcode-importer'), 'type' => 'checkbox', 'std' => 1 // Set to 1 to be checked by default, 0 to be unchecked by default. ); }
and now the code for the main plugin file
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
https://www.ads-software.com/extend/plugins/flickr-shortcode-importer/
- The topic ‘[Plugin: Flickr Shortcode Importer] Support for custom post types’ is closed to new replies.