1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress ping function

Discussion in 'Blogging' started by pharmacyboy, Jun 3, 2008.

  1. pharmacyboy

    pharmacyboy Registered Member

    Joined:
    May 25, 2008
    Messages:
    64
    Likes Received:
    3
    Hello,

    I have my own content system based on WP. I'd like to know which function in WP is responsible for pings and how can i order WP to ping my post ?
     
  2. oldenstylehats

    oldenstylehats Elite Member Premium Member

    Joined:
    Apr 10, 2008
    Messages:
    1,893
    Likes Received:
    1,196
    It's setup as a cronjob via wp-cron.php

    I believe the function is do_all_pings()
     
  3. pharmacyboy

    pharmacyboy Registered Member

    Joined:
    May 25, 2008
    Messages:
    64
    Likes Received:
    3
    tnx, will check it out. I use wp_insert_post to add my posts to WP. Should I also do something else ?

    Do i need to add wp-cron.php to my cron jobs or does WP starts this function from inside wp code ?
     
    Last edited: Jun 3, 2008
  4. oldenstylehats

    oldenstylehats Elite Member Premium Member

    Joined:
    Apr 10, 2008
    Messages:
    1,893
    Likes Received:
    1,196
    I may be wrong, but I believe how it works is that when a new post is made, a status flag is set. The next time that wp-cron is hit (the next time the page loads) it runs the job and all posts with a "ping" status flag set are sent out.

    In terms of how to add posts, if it's working, I'd go with it.
     
    • Thanks Thanks x 1
  5. pharmacyboy

    pharmacyboy Registered Member

    Joined:
    May 25, 2008
    Messages:
    64
    Likes Received:
    3
    wp_insert_post will set "status flag" or i need to set it using another function ?
     
  6. oldenstylehats

    oldenstylehats Elite Member Premium Member

    Joined:
    Apr 10, 2008
    Messages:
    1,893
    Likes Received:
    1,196
    I'm not sure exactly. Your best bet would be to start reading here:
    Code:
    http://wordpress.org/search/do_all_pings?forums=1
    Hope that helps!
     
  7. pharmacyboy

    pharmacyboy Registered Member

    Joined:
    May 25, 2008
    Messages:
    64
    Likes Received:
    3
    Thank You. It works :)
     
  8. meannn

    meannn Supreme Member

    Joined:
    Apr 22, 2009
    Messages:
    1,461
    Likes Received:
    1,896
    Occupation:
    Unemployed Winner
    Location:
    TR
    Hello, can you please share it in here ? Thanks...
     
  9. adbox

    adbox Power Member

    Joined:
    May 1, 2009
    Messages:
    658
    Likes Received:
    107
    Home Page:
    Code:
    <?php generic_ping( $post_id ) ?>
     
  10. longshan2009

    longshan2009 Newbie

    Joined:
    Oct 19, 2009
    Messages:
    21
    Likes Received:
    2
    Home Page:
    Hello, can you please share it in here ? Thanks...