Post to Facebook

This topic contains 7 replies, has 2 voices, and was last updated by  Stiofan O’Connor 8 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #40023

    martinwi
    Expired Member
    Post count: 34

    Hi,

    I really need to get a post to Facebook on occasions other than just a new place addition.

    I have a rather heavy import to do and don’t want them to fire off a load of posts, but I do want to be able to be able to manage this, after the import, in some way.

    Is there a manual workaround I can do to set the published flag to draft and then back to published or something to make sure any Place updates or claims are also posted to Facebook?

    I have added an enhancement request, but desperately need a workaround for now.

    #40026

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi,

    When doing a large import i would suggest disabling the addon and then re-enabeling after.

    The system checks when a post previously not having the status of pusblsh then goes to publish, it then copies the ID and title to a WP option

    get_option( 'gdfi_post_to_facebook');

    You could do your manual way many ways but a simple way would be to update the option with an array of your posts you want publshed (i would not do more than a few at a time as it will run the next time someone visits the frontend of your site so could cause a long wait for someone.

    EXAMPLE CODE, NOT TESTED:

    
    
    $my_posts = array(
        array('ID'=>123,'title'=>'the post title for 123'),
        array('ID'=>124,'title'=>'the post title for 124'),
        array('ID'=>125,'title'=>'the post title for 125'),
        array('ID'=>126,'title'=>'the post title for 126'),
    );
    update_option( 'gdfi_post_to_facebook',$my_posts);

    Stiofan

    #40053

    martinwi
    Expired Member
    Post count: 34

    Thanks Stiofan. I’ll give that a go.

    Much appreciated!

    #40054

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Your welcome!

    #40132

    martinwi
    Expired Member
    Post count: 34

    Stiofan,

    Struggling with the codex, I’m afraid. Is there actions I could hook onto to when a post is added, updated or claimed so I could automate this?

    #40156

    martinwi
    Expired Member
    Post count: 34

    Am I being silly?

    Do I not just need a filter for gdfi_post_to_facebook and change the criteria?

    #40168

    martinwi
    Expired Member
    Post count: 34

    So, not sure if this is the best way to attack this, but it appears to be nice neat and working fine – certainly for any updates.

    Just in case it helps anyone else…

    I added the Code Snippet Plugin and added the following code (see image).

    Appreciate knowing if this is a reasonable workaround.

    #40175

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    yes looks like that will post every-time a post is updated.

    Stiofan

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket