vendredi 27 février 2015

wp cron task update results every 5 min

I'm having a result function/shortcode which output data from a json script. This json script is being updated every 5 minute so i would like to make a cron task for this function to update it self every 5 minute without duplicating the content on the page? how can this be done on a wordpress page?



function resultpage() {



$output = '';



$output .= '<div id="content">';
$output .= '<div id="part-1">';

$output .= getgames("lol");


$output .= '</div>';
$output .= ' <div id="part-2">';
$output .= getgames("counterstrike");
$output .= ' </div>';
$output .= ' <div id="part-3">';
$output .= getgames("dota2");
$output .= ' </div>';
$output .= ' <div id="part-4">';
$output .= getgames("hearthstone");
$output .= ' </div>';
$output .= '</div>';




return $output;
}
add_shortcode('resultpage', 'resultpage');

Aucun commentaire:

Enregistrer un commentaire