コード例 #1
0
 public static function create_meta_boxes()
 {
     global $post, $campaign_data, $cfg;
     $campaign_data = WPeMatico::get_campaign($post->ID);
     //$campaign_data = self :: check_campaigndata($campaign_data);
     $cfg = get_option(WPeMatico::OPTION_KEY);
     $cfg = WPeMatico::check_options($cfg);
     //	add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );
     add_meta_box('cron-box', __('Campaign Schedule', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'cron_box'), 'wpematico', 'side', 'default');
     add_meta_box('cat-box', __('Campaign Categories', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'cat_box'), 'wpematico', 'side', 'default');
     add_meta_box('tags-box', __('Tags generation', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'tags_box'), 'wpematico', 'side', 'default');
     add_meta_box('log-box', __('Send log', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'log_box'), 'wpematico', 'side', 'default');
     add_meta_box('feeds-box', __('Feeds for this Campaign', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'feeds_box'), 'wpematico', 'normal', 'default');
     add_meta_box('options-box', __('Options for this campaign', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'options_box'), 'wpematico', 'normal', 'default');
     add_meta_box('images-box', __('Options for images', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'images_box'), 'wpematico', 'normal', 'default');
     add_meta_box('template-box', __('Post Template', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'template_box'), 'wpematico', 'normal', 'default');
     if ($cfg['enableword2cats']) {
         // Si está habilitado en settings, lo muestra
         add_meta_box('word2cats-box', __('Word to Category options', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'word2cats_box'), 'wpematico', 'normal', 'default');
     }
     if ($cfg['enablerewrite']) {
         // Si está habilitado en settings, lo muestra
         add_meta_box('rewrite-box', __('Rewrite options', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'rewrite_box'), 'wpematico', 'normal', 'default');
     }
     //***** Call nonstatic
     if ($cfg['nonstatic']) {
         NoNStatic::meta_boxes($campaign_data, $cfg);
     }
     // Publish Meta_box edited
     add_action('post_submitbox_start', array(__CLASS__, 'post_submitbox_start'));
 }
コード例 #2
0
    public static function create_meta_boxes()
    {
        global $post, $campaign_data, $cfg, $helptip;
        $campaign_data = WPeMatico::get_campaign($post->ID);
        $campaign_data = apply_filters('wpematico_check_campaigndata', $campaign_data);
        $cfg = get_option(WPeMatico::OPTION_KEY);
        $cfg = apply_filters('wpematico_check_options', $cfg);
        $helptip = array('rewrites' => __('The rewrite feature allow you to replace words or phrases of the content with the text you specify.', WPeMatico::TEXTDOMAIN) . ' ' . __('Also can use this feature to make simple links from some words with origin and re-link fields.', WPeMatico::TEXTDOMAIN) . '<br>' . __('For examples click on [?] below.', WPeMatico::TEXTDOMAIN), 'feeds' => __('You must type at least one feed url.', WPeMatico::TEXTDOMAIN) . '  ' . __('(Less feeds equal less used resources when fetching).', WPeMatico::TEXTDOMAIN) . ' ' . __('Type the domain name to try to autodetect the feed url.', WPeMatico::TEXTDOMAIN), 'itemfetch' => __('Items to fetch PER every feed above.', WPeMatico::TEXTDOMAIN) . '  ' . __('Recommended values are between 3 and 5 fetching more times to not lose items.', WPeMatico::TEXTDOMAIN) . '  ' . __('Set it to 0 for unlimited.', WPeMatico::TEXTDOMAIN), 'itemdate' => __('Use the original date from the post instead of the time the post is created by WPeMatico.', WPeMatico::TEXTDOMAIN) . '  ' . __('To avoid incoherent dates due to lousy setup feeds, WPeMatico will use the feed date only if these conditions are met:', WPeMatico::TEXTDOMAIN) . '  ' . '<ul style=\'list-style-type: square;margin:0 0 5px 20px;font:0.92em "Lucida Grande","Verdana";\'>
				<li>' . __('The feed item date is not too far in the past (specifically, as much time as the campaign frequency).', WPeMatico::TEXTDOMAIN) . ' </li>
				<li>' . __('The fetched feed item date is not in the future.', WPeMatico::TEXTDOMAIN) . ' </li></ul>', 'itemautor' => __('The created posts will be assigned to this author.', WPeMatico::TEXTDOMAIN), 'linktosource' => __('This option make the title permalink to original URL.', WPeMatico::TEXTDOMAIN) . '<br />' . __('This feature will be ignored if you deactivate Campaign Custom Fields on settings.', WPeMatico::TEXTDOMAIN), 'striplinks' => __('This option take out clickable links from content, leaving just the text.', WPeMatico::TEXTDOMAIN), 'postsauthor' => __('The posts created by this campaign will be assigned to this author.', WPeMatico::TEXTDOMAIN), 'allowpings' => __('Allows pinbacks and trackbacks in the posts created by this campaign.', WPeMatico::TEXTDOMAIN), 'commentstatus' => __('Comments options to these posts.', WPeMatico::TEXTDOMAIN), 'woutfilter' => '<b><i>' . __('Skip the Wordpress post content filters.', WPeMatico::TEXTDOMAIN) . '</i></b>' . '<br>' . __('Save the content exactly how to Simplepie gets it.', WPeMatico::TEXTDOMAIN) . '<br>' . __('Not recommended.', WPeMatico::TEXTDOMAIN), 'schedule' => __('Activate Automatic Mode.', WPeMatico::TEXTDOMAIN) . '<br>' . __('You can define here on what times you wants to fetch this feeds.  This has 5 min. of margin on WP-cron schedules.  If you set up an external cron en WPeMatico Settings, you\'ll get better preciseness.', WPeMatico::TEXTDOMAIN), 'imgoptions' => __('This features will be overridden only for this campaign the general Settings options for images.', WPeMatico::TEXTDOMAIN), 'cancel_imgcache' => __('Checked do not upload the images to your server just for the posts of this campaign.', WPeMatico::TEXTDOMAIN), 'imgcache' => __('All images found in &lt;img&gt; tags will be updated to your current WP Upload Folder, added to Wordpress Media and replaced urls in content. Otherwise remains links to source host server.', WPeMatico::TEXTDOMAIN), 'imgattach' => __('All images will be attached to the owner post in WP media library; necessary for Featured image, but if you see that the job process is too slowly you can deactivate this here.', WPeMatico::TEXTDOMAIN), 'gralnolinkimg' => __('If selected and image upload get error, then delete the \'src\' attribute of the &lt;img&gt;. Check this for don\'t link images from external sites.', WPeMatico::TEXTDOMAIN), 'postemplate' => __('Campaign post template allow to modify the content fetched by adding extra information, such as text, images, campaign data, etc. before save it as post content.', WPeMatico::TEXTDOMAIN) . '<br>' . __('You can use some tags that will be replaced for current value. Click on [?] below to see description and examples on how to use this feature.', WPeMatico::TEXTDOMAIN), 'wordcateg' => __('Allow to assign a singular category to the post if a word is found in the content.', WPeMatico::TEXTDOMAIN), 'category' => __('Add categories from the source post and/or assign already existing categories.', WPeMatico::TEXTDOMAIN), 'autocats' => __('If categories are found on source item, these categories will be added to the post; If category does not exist, then will be created.', WPeMatico::TEXTDOMAIN), 'tags' => __('You can insert here the tags for every post of this campaign.', WPeMatico::TEXTDOMAIN), 'sendlog' => __('An email will be sent with the events of campaign fetching. You can also filter the emails only if an error occurred or left blank to not send emails of this campaign.', WPeMatico::TEXTDOMAIN), 'postformat' => __('If your theme supports post formats you can select one for the posts of this campaign, otherwise left on Standard.', WPeMatico::TEXTDOMAIN));
        foreach ($helptip as $key => $value) {
            $helptip[$key] = htmlentities($value);
        }
        //	add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );
        add_meta_box('format-box', __('Campaign Posts Format', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['postformat'] . '"></span>', array('WPeMatico_Campaign_edit', 'format_box'), 'wpematico', 'side', 'default');
        add_meta_box('cat-box', __('Campaign Categories', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['category'] . '"></span>', array('WPeMatico_Campaign_edit', 'cat_box'), 'wpematico', 'side', 'default');
        add_meta_box('tags-box', __('Tags generation', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['tags'] . '"></span>', array('WPeMatico_Campaign_edit', 'tags_box'), 'wpematico', 'side', 'default');
        add_meta_box('log-box', __('Send log', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['sendlog'] . '"></span>', array('WPeMatico_Campaign_edit', 'log_box'), 'wpematico', 'side', 'default');
        add_meta_box('feeds-box', __('Feeds for this Campaign', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['feeds'] . '"></span>', array('WPeMatico_Campaign_edit', 'feeds_box'), 'wpematico', 'normal', 'default');
        add_meta_box('options-box', __('Options for this campaign', WPeMatico::TEXTDOMAIN), array('WPeMatico_Campaign_edit', 'options_box'), 'wpematico', 'normal', 'default');
        add_meta_box('images-box', __('Options for images', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['imgoptions'] . '"></span>', array('WPeMatico_Campaign_edit', 'images_box'), 'wpematico', 'normal', 'default');
        add_meta_box('template-box', __('Post Template', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['postemplate'] . '"></span>', array('WPeMatico_Campaign_edit', 'template_box'), 'wpematico', 'normal', 'default');
        if ($cfg['enableword2cats']) {
            // Si está habilitado en settings, lo muestra
            add_meta_box('word2cats-box', __('Word to Category options', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['wordcateg'] . '"></span>', array('WPeMatico_Campaign_edit', 'word2cats_box'), 'wpematico', 'normal', 'default');
        }
        if ($cfg['enablerewrite']) {
            // Si está habilitado en settings, lo muestra
            add_meta_box('rewrite-box', __('Rewrite options', WPeMatico::TEXTDOMAIN) . '<span class="mya4_sprite infoIco help_tip" title="' . $helptip['rewrites'] . '"></span>', array('WPeMatico_Campaign_edit', 'rewrite_box'), 'wpematico', 'normal', 'default');
        }
        //***** Call nonstatic
        if ($cfg['nonstatic']) {
            NoNStatic::meta_boxes($campaign_data, $cfg);
        }
        // Publish Meta_box edited
        add_action('post_submitbox_start', array(__CLASS__, 'post_submitbox_start'));
    }