VaultPress::ai_ping_next PHP Method

ai_ping_next() public method

Use an option ID to ensure a unique ping ID for the site.
public ai_ping_next ( ) : integer | false
return integer | false The new ping number. False, if there was an error.
    function ai_ping_next()
    {
        global $wpdb;
        $name = "_vp_ai_ping";
        $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->options}` WHERE `option_name` = %s;", $name));
        $success = $wpdb->query($wpdb->prepare("INSERT INTO `{$wpdb->options}` (`option_name`, `option_value`, `autoload`) VALUES (%s, '', 'no')", $name));
        if (!$success) {
            return false;
        }
        return $wpdb->insert_id;
    }
VaultPress