WordPress.org

Ready to get started?Download WordPress

Forums

How to manually trigger pingback/trackback? (7 posts)

  1. barmala
    Member
    Posted 8 years ago #

    Hi,

    I migrated from my old homemade cms to WordPress by manually populating the database. Several pages are based on the static-page-extended plugin. Due to some conventions introduced in this migration process, I sometimes even write posts by patching the database. However this way I some WordPress actions don't get triggered. One of them seems to be the ping ot other sites. Therefore my question:

    How do I manually trigger the ping in WordPress?

    • Do I have to fill in the field "wp_posts.to_ping"?
    • Should I run "INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('$new_post_ID','_pingme','1');"?
    • Can I trigger then spawn_pinger() ?

    Christian

  2. Pravin Paratey
    Member
    Posted 7 years ago #

    I would like to do something like this. I have some 'pages' that I want to pingback to other urls.

    Has anybody figured out how to do this yet?

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Clearly he never got an answer, but he was basically correct.

    First you add a new row to the postmeta table with the id of the post and the _pingme key name. Like so:
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('whatever the post id is','_pingme','1');

    Now, with old versions, he may have been correct with spawn_pinger, but that's changed in 2.1. Now you would do this with WordPress and some PHP code:
    wp_schedule_single_event(time(), 'do_pings');

    This will make it run the pings on its own time, and you don't have to wait for it.

  4. Pravin Paratey
    Member
    Posted 7 years ago #

    Otto,

    I added a new row to the table. But I can't find the wp_schedule_single_event() function. It isn't there 2.1. I look at the previous revisions and I understand it used to be in wp-admin/upgrade-functions.php.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Actually, that function is new to 2.1. It's the first function in cron.php, however you don't include that directly. You need to include the blog itself, by including wp-blog-header.php. Then you can use that function.

  6. Pravin Paratey
    Member
    Posted 7 years ago #

    I don't have cron.php.

    I also downloaded the latest release to check if I had missed some files during the upgrade, but no cron.php there either.

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I don't have cron.php.

    Then you don't have WordPress version 2.1 (or later). It's in there.

    I just downloaded it and took a look. And yep, it's still in there.

Topic Closed

This topic has been closed to new replies.

About this Topic