• Resolved jerryskate

    (@jerryskate)


    I wonder if it would be possible to use publicize with WP RSS Agreggator? Im not publicing my feeds as posts, but publicize has supprt for custom post types, so maybe that could be a way? Im unsure how non-post assign feeds are stored?

    This is the action I would have to use:

    add_action('init', 'my_custom_init');
    function my_custom_init() {
        add_post_type_support( 'product', 'publicize' );
    }

    Hmm on further investigation, is the post type for feeds wprss_feed_item?

    Coukd I use the action directly in Functions, or do i need to register the wprss_feed_item post type?

    This is the register post type code for publicize:

    // Register Custom Post Type
    function custom_post_type() {
    
        $labels = array(
            'name'                => _x( 'Products', 'Post Type General Name', 'text_domain' ),
        );
        $args = array(
            'label'               => __( 'product', 'text_domain' ),
            'supports'            => array( 'title', 'editor', 'publicize', 'wpcom-markdown' ),
        );
        register_post_type( 'product', $args );
    
    }
    // Hook into the 'init' action
    add_action( 'init', 'custom_post_type', 0 );
    https://wordpress.org/plugins/wp-rss-aggregator/

    Sorry if I kinda extended my question beyond normal support..

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jerryskate

    (@jerryskate)

    The first action does work. However if of course shows a non-working link to the feed that got posted. Hmm. If i could use a static link that goes with the autopost that directs to my frontpage, then it would work. So close!

    Plugin Author Miguel Muscat

    (@mekku)

    Hi Jerry, Forgive me for the delayed reply.

    Yes, the post type of imported feed items is wprss_feed_item.
    It is registered on the init action, with a normal priority of 10. This means that it is available for you to use in your code at init, with priority 11 or more.

    The links you are getting are non-working because the custom post types do not have a display of their own. Rather, they are displayed by the short code.

    If you are good with PHP and WordPress coding, what you can probably do is create a page that uses GET parameters to inject the shortcode. The shortcode of the plugin can be called programmatically:

    // $attr parameter is an associative array containing the shortcode attributes
    // ex. [ limit => 10, source => 523 ]
    wprss_shortcode( $attr )

    But even then, you wouldn’t be displaying just 1 feed item. You might have to use some smart JavaScript to maybe highlight that particular item.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use jetpack publicize wit RSS Aggreagtor?’ is closed to new replies.