当前位置: 首页>>代码示例>>PHP>>正文


PHP Campaign::getByBlogId方法代码示例

本文整理汇总了PHP中Campaign::getByBlogId方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::getByBlogId方法的具体用法?PHP Campaign::getByBlogId怎么用?PHP Campaign::getByBlogId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Campaign的用法示例。


在下文中一共展示了Campaign::getByBlogId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: webcontatos_recriar

/**
 * 
 */
function webcontatos_recriar()
{
    if (is_super_admin()) {
        $data = array();
        $campaign = Campaign::getByBlogId(get_current_blog_id());
        $data['domain'] = $campaign->domain;
        $data['blog_id'] = get_current_blog_id();
        webcontatos_Campaign_created($data);
    }
}
开发者ID:adenilsonpaiva,项目名称:redelivre,代码行数:13,代码来源:WPWebContatos.php

示例2: foreach

}
// inclui os widgets
foreach (glob(WPMU_PLUGIN_DIR . '/includes/widgets/*.php') as $file) {
    require_once $file;
}
//db updates -- eventualmente podemos não incluir mais
include WPMU_PLUGIN_DIR . '/includes/db-updates.php';
$campaign = null;
// load code used only for campaign sites (exclude main site)
if (!is_main_site()) {
    // must wait for wordpress to finish loading before loading campaign code
    add_action('init', function () {
        global $blog_id, $campaign;
        require_once __DIR__ . '/includes/payment.php';
        require_once __DIR__ . '/includes/admin-contact.php';
        $campaign = Campaign::getByBlogId($blog_id);
        require_once __DIR__ . '/includes/graphic_material/GraphicMaterialManager.php';
        GraphicMaterialManager::setUp();
        if (is_admin()) {
            require_once __DIR__ . '/includes/load_menu_options.php';
        }
        add_action('template_redirect', 'campanha_check_payment_status');
        add_action('template_redirect', 'campanha_check_plan_and_theme');
        add_action('template_redirect', 'campaign_base_template_redirect_intercept');
        add_action('admin_notices', 'campanha_admin_messages');
        add_action('admin_init', 'campanha_remove_menu_pages');
        add_action('load-ms-delete-site.php', 'campanha_remove_exclude_site_page_content');
        add_action('wp_dashboard_setup', 'campannha_dashboard_widget');
        add_action('load-options-general.php', 'campanha_custom_options_strings');
        add_action('wp_print_scripts', 'campanha_uservoice_js');
        add_filter('query_vars', 'campaign_base_custom_query_vars');
开发者ID:cabelotaina,项目名称:redelivre,代码行数:31,代码来源:functions.php

示例3: jaiminho_create_credentials

function jaiminho_create_credentials($blogId = null)
{
    if (is_null($blogId)) {
        global $blog_id;
        $blogId = $blog_id;
    }
    $errors = array();
    $blog_details = get_blog_details($blogId);
    $id = explode('.', $blog_details->domain);
    $id = $id[0];
    // Muda para o blog principal para pegar as configurações padrão
    switch_to_blog(1);
    $opt = jaiminho_get_config();
    restore_current_blog();
    $opt_contatos = get_option('webcontatos-config');
    if (!isset($opt_contatos['webcontatos_pass'])) {
        $opt_contatos['webcontatos_pass'] = md5(uniqid());
        update_option('webcontatos-config', $opt_contatos);
    }
    $campaign = Campaign::getByBlogId($blog_details->blog_id);
    $plan_capabilities = Capability::getByPlanId($campaign->plan_id);
    $limite_emails = (int) $plan_capabilities->send_messages->value * 1000;
    $output_headers = null;
    try {
        $client = new SoapClient($opt['jaiminho_url'] . '/james_bridge.php?wsdl', array('exceptions' => true));
        $defaultmailinglist_id = $client->__soapCall('createadmin', array('apikeymaster' => $opt['jaiminho_apikey'], 'name' => get_blog_option($blog_details->blog_id, 'blogname'), 'username' => $id, 'email' => 'contato@' . $blog_details->domain, 'password' => $opt_contatos['webcontatos_pass'], 'plan' => $limite_emails), array(), null, $output_headers);
    } catch (Exception $ex) {
        $errors[] = '(' . $ex->faultcode . ') ' . $ex->faultstring . ' - ' . $ex->detail;
    }
    $opt['jaiminho_user'] = $id;
    $opt['jaiminho_pass'] = $opt_contatos['webcontatos_pass'];
    update_option('jaiminho-config', $opt);
    add_option('widget_jaiminho', array('title' => 'Cadastre seu e-mail', 'jaiminho_text' => 'Receba novidades da campanha', 'jaiminho_id' => $defaultmailinglist_id));
    $sidebar_widget = get_option("sidebars_widgets");
    $sidebar_widget['sidebar-1'] = array_merge(array("jaiminho"), $sidebar_widget['sidebar-1']);
    update_option("sidebars_widgets", $sidebar_widget);
    if (count($errors) > 0) {
        update_option('jaiminho-error-log', $errors);
    } else {
        delete_option('jaiminho-error-log');
    }
}
开发者ID:cabelotaina,项目名称:redelivre,代码行数:42,代码来源:WPJaiminho.php


注:本文中的Campaign::getByBlogId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。