fb-instant-articles icon indicating copy to clipboard operation
fb-instant-articles copied to clipboard

Add option to disable plugin for a single post

Open timjacobi opened this issue 7 years ago • 12 comments

As requested in #567 it would be great if we could allow people disable publishing on a per article basis. A checkbox should be enough.

timjacobi avatar Oct 02 '17 14:10 timjacobi

any news?

webgrafia avatar Oct 19 '17 15:10 webgrafia

Momentarily we are focused on fixing bugs and will prioritise feature requests after. Feel free to submit a PR though.

timjacobi avatar Oct 19 '17 15:10 timjacobi

Thanks timjacobi in the meantime I discovered instant_articles_should_submit_post filter, that can be used to add a metabox to control single article. Example:


add_filter("instant_articles_should_submit_post", "my_instant_articles_should_submit_post",10, 2);
function my_instant_articles_should_submit_post($should_show, $IA_object){
    if($should_show){
    . . . 
    // get post meta managed by metabox
    if(get_post_meta($IA_object->get_the_id(), "enable_ia"))
        return true
    }
    return false;
}

webgrafia avatar Oct 20 '17 10:10 webgrafia

Feel free to submit a PR and I’ll review it :-)

timjacobi avatar Oct 20 '17 11:10 timjacobi

Working on this.

paulschreiber avatar Jan 10 '19 18:01 paulschreiber

Thanks timjacobi in the meantime I discovered instant_articles_should_submit_post filter, that can be used to add a metabox to control single article. Example:


add_filter("instant_articles_should_submit_post", "my_instant_articles_should_submit_post",10, 2);
function my_instant_articles_should_submit_post($should_show, $IA_object){
    if($should_show){
    . . . 
    // get post meta managed by metabox
    if(get_post_meta($IA_object->get_the_id(), "enable_ia"))
        return true
    }
    return false;
}

Hi, Is this still valid to exclude single post? So, I can use this code to exclude any post to FBIA? I am looking for a solution to exclude single post of FBIA. Hopefully, someone will guide me. TQVM

Sazarimma avatar Aug 01 '19 11:08 Sazarimma

@Sazarimma see my pull request (#1011) which provides this feature.

paulschreiber avatar Aug 03 '19 15:08 paulschreiber

Hi @paulschreiber , Thank you so much for your help. I am not sure how to implement this since its so confusing me and I am beginner. I want to know which one is correct.

I have to edit this one only right? > class-instant-articles-publish-meta-box.php based on this > add metabox action to toggle publish status Am I right?

I'm so sorry for taking your time. I can edit them myself, it just not sure which one and where do I start it first. So, if possible please show me the step. TQVM for your help.

Sazarimma avatar Aug 06 '19 20:08 Sazarimma

@Sazarimma you're going to need to find someone who understands how to get a plugin from GitHub and install it on your server to help you out.

paulschreiber avatar Aug 07 '19 18:08 paulschreiber

@paulschreiber No one will help me. But after I read a few articles, I understand that I have to download and upload it to my site. I download the plugin as shown on the image attach here. Is it correct? Currently, I have FBIA original plugin, do I have to remove it or just let it be? Sorry for many question. I want to learn. Thanks for your time. zsa

Sazarimma avatar Aug 08 '19 03:08 Sazarimma

@Sazarimma Yes, you need to remove the original FBIA plugin and replace it with the downloaded version from your screen shot.

paulschreiber avatar Aug 13 '19 03:08 paulschreiber

@paulschreiber THANK YOU SO MUCH. I seriously appreciate it.

Sazarimma avatar Aug 15 '19 04:08 Sazarimma

This issue has been marked stale because it has been open for 30 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

github-actions[bot] avatar Oct 17 '22 00:10 github-actions[bot]