function pof_item_suggestions_meta_box_callback($post)
{
    $suggestions = pof_get_suggestions($post);
    echo "<ul style=\"margin-left: 10px; list-style-type: round;\">";
    foreach ($suggestions as $suggestion_key => $suggestion_post) {
        echo "<li>";
        echo "<a href=\"/wp-admin/post.php?post=" . $suggestion_post->ID . "&action=edit\" target=\"_blank\">" . $suggestion_post->post_title . "</a> (" . get_post_meta($suggestion_post->ID, "pof_suggestion_lang", true) . ")";
        echo "</li>";
    }
    echo "</ul>";
}
Ejemplo n.º 2
0
header('Content-type: application/json');
$lastModified = strtotime('2010-01-01');
$lastModifiedBy = 0;
$lastModifiedByName = "";
$post_guid = $_GET["postGUID"];
$args = array('numberposts' => -1, 'posts_per_page' => -1, 'post_type' => array('pof_post_task', 'pof_post_taskgroup', 'pof_post_program', 'pof_post_agegroup'), 'meta_key' => 'post_guid', 'meta_value' => $post_guid);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
    while ($the_query->have_posts()) {
        $the_query->the_post();
        $task_post = $the_query->post;
    }
}
$pof_settings_lastupdate_overwrite = pof_settings_get_lastupdate_overwrite();
pof_checkDatetime($task_post);
$suggestions = pof_get_suggestions($post);
$lang = "fi";
if (!empty($_GET["lang"])) {
    $lang = strtolower($_GET["lang"]);
}
$jsonItem = new stdClass();
$jsonItem->items = array();
$jsonItem->lang = strtoupper($lang);
$jsonItem->post = new stdClass();
$jsonItem->post->id = $task_post->ID;
$jsonItem->post->title = $task_post->post_title;
$jsonItem->post->guid = get_post_meta($task_post->ID, "post_guid", true);
foreach ($suggestions as $suggestion) {
    $suggestiong_lang = get_post_meta($suggestion->ID, "pof_suggestion_lang", true);
    if (strtolower($suggestiong_lang) == $lang || $lang == 'fi' && $suggestiong_lang == '') {
        $suggestiong_writer = get_post_meta($suggestion->ID, "pof_suggestion_writer", true);