WordPress.org

Ready to get started?Download WordPress

Forums

Amazon Product in a Post Plugin
[resolved] [Plugin: Amazon Product In a Post Plugin] Feature Suggestion - Custom Post Types (4 posts)

  1. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 2 years ago #

    This seems to be the best plugin available for displaying products from amazon. Is it possible for the plugin to be made to support Custom Post Types in addition to Pages/Posts? It wouldn't need to create a new custom Post type, but it would add to the flexibility greatly be able to provide the normal functionality of the plugin on custom Post types.

    http://wordpress.org/extend/plugins/amazon-product-in-a-post-plugin/

  2. prophecy2040
    Member
    Plugin Author

    Posted 2 years ago #

    this will be added to a future version, but for now, you can add this to your theme functions.php file to hook into the custom post type:

    global $appipBulidBox;
    $custom_post_type = 'put-post-type-here';
    add_action('admin_menu', create_function("$appipBulidBox","if( function_exists( 'add_meta_box' ))add_meta_box( 'amazonProductInAPostBox1', __( 'Amazon Product In a Post Settings', 'appplugin' ), 'amazonProductInAPostBox1', $custom_post_type, 'normal', 'high' );"));

    Be sure to change the 'put-post-type-here' into your actual custom post type name.

    Regards,
    Don

  3. prophecy2040
    Member
    Plugin Author

    Posted 2 years ago #

    Actually, you should probably throw a 'function_exists' conditional around that just in case you uninstall the plugin in the future - that way it will not have a fatal error.

    Like so:

    if(function_exists('amazonProductInAPostBox1')){
    	global $appipBulidBox;
    	$custom_post_type = 'put-post-type-here';
    	add_action('admin_menu', create_function("$appipBulidBox",
    "if( function_exists( 'add_meta_box' ))add_meta_box( 'amazonProductInAPostBox1',
    __( 'Amazon Product In a Post Settings', 'appplugin' ), 'amazonProductInAPostBox1', $custom_post_type, 'normal', 'high' );"));
    }

    Regards,
    Don

  4. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 2 years ago #

    Many thanks Don, I'll give that a try

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic