Support » Plugin: Amazon Product in a Post Plugin » [Plugin: Amazon Product In a Post Plugin] Feature Suggestion – Custom Post Types

  • ResolvedModerator cubecolour

    (@numeeja)


    ɹoʇɐɹǝpoɯ

    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Don Fischer

    (@prophecy2040)

    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

    Plugin Author Don Fischer

    (@prophecy2040)

    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

    Moderator cubecolour

    (@numeeja)

    ɹoʇɐɹǝpoɯ

    Many thanks Don, I’ll give that a try

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Amazon Product In a Post Plugin] Feature Suggestion – Custom Post Types’ is closed to new replies.