• Resolved phil_b

    (@phil_b)


    Hi there,

    Firstly, thanks for the plugin ??

    I’m wondering if you could add custom post-type support? I think it only supports ‘post’ as the moment, but I need it to be used with a different post-type.

    I have managed to fix the code so it works for me by changing the target post type on a couple of lines in class-subscribe.php. If I ever update the plugin this will get overwritten though. I changed lines 843 and 253 and it would be simple to add an option in settings to select what post-type you want to use it for.

    I hope my suggestion is useful.

    regards

    https://www.ads-software.com/plugins/subscribe-to-category/

Viewing 6 replies - 1 through 6 (of 6 total)
  • ironivan89

    (@ironivan89)

    When you change the target post-type it will show only the custom taxonomies assigned to this custom-post-type on the subscription form?
    thanks

    Hi Pill, Im seaerching for exactly the same thing!
    Could you please tell me where exacly you changed the post-type I’m kinda new at this and wvwn If I’m willing to try I don’t want to fuked up ??

    Thanks!

    Thread Starter phil_b

    (@phil_b)

    Hey there,

    Yea, so my post type is ‘job’ and I made the following changes:

    ——

    in file:
    wp-plugins/subscribe-to-category/classes/class-subscribe.php

    line 842 had this:

    $args = array(
    ‘post_type’ => ‘post’,
    ‘post_status’ => ‘publish’,
    ‘numberposts’ => -1,
    ‘meta_key’ => $meta_key,
    ‘meta_value’ => $meta_value
    );

    I changed the post_type to ‘job’, i.e ‘post_type’ => ‘post’,

    —–

    line 253 had this:

    if( isset( $_POST[‘post_type’] ) && $_POST[‘post_type’] != ‘post’ )

    I changed the post_type to ‘job’, i.e $_POST[‘post_type’] != ‘job’,

    ——

    I think that was it. Now whenever a job is added in admin then the plugin is used for that.

    Just back up the file and change to match your post type.

    Plugin Contributor dansod

    (@dansod)

    Hi there!
    Thanks for your input, I have thought about this for a while, making it possible to use for custom post types.

    I′m glad you found a work around to use until it works right out of the box.

    Hang on, so it’s currently NOT possible to use with custom post types?

    It’s MEANT to work only with “posts”–not pages, etc, etc….?

    *sobs quietly*

    Plugin Contributor dansod

    (@dansod)

    Yes. Right now there is no support for custom post type and custom taxonomies. It’s a nice feature though so I hope to have a solution pretty soon.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘custom post-type support’ is closed to new replies.