Ejemplo n.º 1
0
function cherry_plugin_check_for_update($transient)
{
    global $cherry_plugin_details_url;
    $remote_query = cherry_plugin_remote_query(array('data_type' => 'plugin'));
    if ($remote_query != NULL) {
        $cherry_plugin_details_url = $remote_query['url'];
        add_action('admin_head', 'cherry_change_details_link');
        $response = array('slug' => dirname(CHERRY_PLUGIN_SLUG), 'new_version' => $remote_query['new_version'], 'url' => $remote_query['url'], 'package' => $remote_query['package']);
        $transient->response[CHERRY_PLUGIN_SLUG] = (object) $response;
    }
    return $transient;
}
Ejemplo n.º 2
0
function cherry_plugin_help_export_popup()
{
    $video_src = cherry_plugin_remote_query(array('data_type' => 'info'));
    $video_src = $video_src['video_help_export'];
    $out = '<div id="help_export" style="display:none;">';
    $out .= '<div style="text-align:center">';
    $out .= '<p>' . __('Files are downloaded as a .zip archive', CHERRY_PLUGIN_DOMAIN) . '</p>';
    $out .= '<iframe width="585" height="440" src="' . $video_src . '" frameborder="0" allowfullscreen></iframe>';
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
Ejemplo n.º 3
0
 public function get_header($attr)
 {
     $default = array('title' => '', 'wrapper_class' => '', 'wrapper_id' => '');
     extract(array_merge($default, $attr));
     $language = get_bloginfo("language");
     switch ($language) {
         case 'ru-RU':
             $locals = '_' . $language;
             break;
         case 'es-ES':
             $locals = '_' . $language;
             break;
         case 'de-DE':
             $locals = '_' . $language;
             break;
         default:
             $locals = '';
             break;
     }
     $get_remote_info = cherry_plugin_remote_query(array('data_type' => 'info'));
     $support_link = $get_remote_info['support_url' . $locals];
     $doc_link = $get_remote_info['document_url'];
     if (class_exists('Woocommerce')) {
         $doc_link = $get_remote_info['document_url_woocommerce'];
     } elseif (function_exists('jigoshop_init')) {
         $doc_link = $get_remote_info['document_url_jigoshop'];
     }
     $output = '<div class="wrap cherry-plugin">';
     $output .= '<header><h2>';
     $output .= $title ? $title : '';
     $output .= '<span class="extern-links">';
     $output .= '<a href="' . $doc_link . '" target="_blank"><span class="icon-book"></span>' . __('Documentation', CHERRY_PLUGIN_DOMAIN) . '</a>';
     $output .= '<a href="' . $support_link . '" target="_blank"><span class="icon-wrench"></span>' . __('Support', CHERRY_PLUGIN_DOMAIN) . '</a>';
     $output .= '</span></h2>';
     $output_wrapper_id = $wrapper_id ? 'id="' . $wrapper_id . '"' : '';
     $output .= '</header><div class="clear"></div><div ' . $output_wrapper_id . ' class="' . $wrapper_class . ' stuffbox postbox">';
     echo $output;
 }