當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GADWP函數代碼示例

本文整理匯總了PHP中GADWP函數的典型用法代碼示例。如果您正苦於以下問題:PHP GADWP函數的具體用法?PHP GADWP怎麽用?PHP GADWP使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GADWP函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) && 1 == $this->gadwp->config->options['dashboard_widget']) {
         add_action('wp_dashboard_setup', array($this, 'add_widget'));
     }
 }
開發者ID:linniepinski,項目名稱:perssistant,代碼行數:7,代碼來源:widgets.php

示例2: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) || GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front'])) {
         add_action('wp_ajax_gadwp_set_error', array($this, 'ajax_set_error'));
     }
 }
開發者ID:tuanlibra,項目名稱:thptxuanang,代碼行數:7,代碼來源:ajax-actions.php

示例3: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     add_filter('the_content', array($this, 'add_content'));
     // Frontend Styles
     add_action('wp_enqueue_scripts', array($this, 'load_styles_scripts'));
 }
開發者ID:healthcommcore,項目名稱:osnap,代碼行數:7,代碼來源:item-reports.php

示例4: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) && (1 == $this->gadwp->config->options['backend_item_reports'] || 1 == $this->gadwp->config->options['dashboard_widget'])) {
         // Items action
         add_action('wp_ajax_gadwp_backend_item_reports', array($this, 'ajax_item_reports'));
     }
 }
開發者ID:mervick,項目名稱:Google-Analytics-Dashboard-for-WP,代碼行數:8,代碼來源:ajax-actions.php

示例5: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     include_once GADWP_DIR . 'tools/autoload.php';
     $config = new Google_Config();
     $config->setCacheClass('Google_Cache_Null');
     if (function_exists('curl_version')) {
         $curlversion = curl_version();
         if (isset($curlversion['version']) && version_compare(PHP_VERSION, '5.3.0') >= 0 && version_compare($curlversion['version'], '7.10.8') >= 0 && defined('GADWP_IP_VERSION') && GADWP_IP_VERSION) {
             $config->setClassConfig('Google_IO_Curl', array('options' => array(CURLOPT_IPRESOLVE => GADWP_IP_VERSION)));
             // Force CURL_IPRESOLVE_V4 or CURL_IPRESOLVE_V6
         }
     }
     $this->client = new Google_Client($config);
     $this->client->setScopes('https://www.googleapis.com/auth/analytics.readonly');
     $this->client->setAccessType('offline');
     $this->client->setApplicationName('Google Analytics Dashboard');
     $this->client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
     $this->set_error_timeout();
     $this->managequota = 'u' . get_current_user_id() . 's' . get_current_blog_id();
     $this->access = array_map(array($this, 'map'), $this->access);
     if ($this->gadwp->config->options['ga_dash_userapi']) {
         $this->client->setClientId($this->gadwp->config->options['ga_dash_clientid']);
         $this->client->setClientSecret($this->gadwp->config->options['ga_dash_clientsecret']);
         $this->client->setDeveloperKey($this->gadwp->config->options['ga_dash_apikey']);
     } else {
         $this->client->setClientId($this->access[0]);
         $this->client->setClientSecret($this->access[1]);
     }
     $this->service = new Google_Service_Analytics($this->client);
     if ($this->gadwp->config->options['ga_dash_token']) {
         $token = $this->gadwp->config->options['ga_dash_token'];
         if ($token) {
             try {
                 $this->client->setAccessToken($token);
                 $gadwp->config->options['ga_dash_token'] = $this->client->getAccessToken();
             } catch (Google_IO_Exception $e) {
                 GADWP_Tools::set_cache('ga_dash_lasterror', date('Y-m-d H:i:s') . ': ' . esc_html($e), $this->error_timeout);
             } catch (Google_Service_Exception $e) {
                 GADWP_Tools::set_cache('ga_dash_lasterror', date('Y-m-d H:i:s') . ': ' . esc_html("(" . $e->getCode() . ") " . $e->getMessage()), $this->error_timeout);
                 GADWP_Tools::set_cache('ga_dash_gapi_errors', array($e->getCode(), (array) $e->getErrors()), $this->error_timeout);
                 $this->reset_token();
             } catch (Exception $e) {
                 GADWP_Tools::set_cache('ga_dash_lasterror', date('Y-m-d H:i:s') . ': ' . esc_html($e), $this->error_timeout);
                 $this->reset_token();
             }
             if (is_multisite() && $this->gadwp->config->options['ga_dash_network']) {
                 $this->gadwp->config->set_plugin_options(true);
             } else {
                 $this->gadwp->config->set_plugin_options();
             }
         }
     }
 }
開發者ID:RagnarDanneskjold,項目名稱:goodbyeloans.com,代碼行數:54,代碼來源:gapi.php

示例6: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front']) && $this->gadwp->config->options['frontend_item_reports']) {
         // Item Reports action
         add_action('wp_ajax_gadwp_frontend_item_reports', array($this, 'ajax_item_reports'));
     }
     // Frontend Widget actions
     add_action('wp_ajax_ajax_frontwidget_report', array($this, 'ajax_frontend_widget'));
     add_action('wp_ajax_nopriv_ajax_frontwidget_report', array($this, 'ajax_frontend_widget'));
 }
開發者ID:misfist,項目名稱:missdrepants-network,代碼行數:11,代碼來源:ajax-actions.php

示例7: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front']) && ($this->gadwp->config->options['ga_dash_frontend_stats'] || $this->gadwp->config->options['ga_dash_frontend_keywords'])) {
         // Frontend Reports/Page action
         add_action('wp_ajax_gadash_get_frontend_pagereports', array($this, 'ajax_afterpost_reports'));
     }
     // Frontend Widget actions
     add_action('wp_ajax_gadash_get_frontendwidget_data', array($this, 'ajax_frontend_widget'));
     add_action('wp_ajax_nopriv_gadash_get_frontendwidget_data', array($this, 'ajax_frontend_widget'));
 }
開發者ID:healthcommcore,項目名稱:osnap,代碼行數:11,代碼來源:ajax-actions.php

示例8: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) && (1 == $this->gadwp->config->options['backend_item_reports'] || 1 == $this->gadwp->config->options['dashboard_widget'])) {
         // Items action
         add_action('wp_ajax_gadwp_backend_item_reports', array($this, 'ajax_item_reports'));
     }
     if (current_user_can('manage_options')) {
         // Admin Widget action
         add_action('wp_ajax_gadwp_dismiss_notices', array($this, 'ajax_dismiss_notices'));
     }
 }
開發者ID:lilweirdward,項目名稱:blofishwordpress,代碼行數:12,代碼來源:ajax-actions.php

示例9: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_back']) && 1 == $this->gadwp->config->options['backend_item_reports']) {
         // Add custom column in Posts List
         add_filter('manage_posts_columns', array($this, 'add_columns'));
         // Populate custom column in Posts List
         add_action('manage_posts_custom_column', array($this, 'add_icons'), 10, 2);
         // Add custom column in Pages List
         add_filter('manage_pages_columns', array($this, 'add_columns'));
         // Populate custom column in Pages List
         add_action('manage_pages_custom_column', array($this, 'add_icons'), 10, 2);
     }
 }
開發者ID:jdiponziano,項目名稱:thelifeoutside.com,代碼行數:14,代碼來源:item-reports.php

示例10: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     // Styles & Scripts
     add_action('admin_enqueue_scripts', array($this, 'load_styles_scripts'));
     // Site Menu
     add_action('admin_menu', array($this, 'site_menu'));
     // Network Menu
     add_action('network_admin_menu', array($this, 'network_menu'));
     // Settings link
     add_filter("plugin_action_links_" . plugin_basename(GADWP_DIR . 'gadwp.php'), array($this, 'settings_link'));
     // Error bubble
     add_action('admin_print_scripts', array($this, 'draw_error_bubble'), 10000);
 }
開發者ID:healthcommcore,項目名稱:osnap,代碼行數:14,代碼來源:setup.php

示例11: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     // Styles & Scripts
     add_action('admin_enqueue_scripts', array($this, 'load_styles_scripts'));
     // Site Menu
     add_action('admin_menu', array($this, 'site_menu'));
     // Network Menu
     add_action('network_admin_menu', array($this, 'network_menu'));
     // Settings link
     add_filter("plugin_action_links_" . plugin_basename(GADWP_DIR . 'gadwp.php'), array($this, 'settings_link'));
     // Updated admin notice
     add_action('admin_notices', array($this, 'admin_notice'));
 }
開發者ID:zakaria340,項目名稱:critique,代碼行數:14,代碼來源:setup.php

示例12: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     include_once GADWP_DIR . 'tools/autoload.php';
     $config = new Google_Config();
     $config->setCacheClass('Google_Cache_Null');
     if (function_exists('curl_version')) {
         $curlversion = curl_version();
         if (isset($curlversion['version']) && version_compare(PHP_VERSION, '5.3.0') >= 0 && version_compare($curlversion['version'], '7.10.8') >= 0 && defined('GADWP_IP_VERSION') && GADWP_IP_VERSION) {
             $config->setClassConfig('Google_IO_Curl', array('options' => array(CURLOPT_IPRESOLVE => GADWP_IP_VERSION)));
             // Force
             // CURL_IPRESOLVE_V4
             // or
             // CURL_IPRESOLVE_V6
         }
     }
     $this->client = new Google_Client($config);
     $this->client->setScopes('https://www.googleapis.com/auth/analytics.readonly');
     $this->client->setAccessType('offline');
     $this->client->setApplicationName('Google Analytics Dashboard');
     $this->client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
     $this->set_error_timeout();
     $this->managequota = 'u' . get_current_user_id() . 's' . get_current_blog_id();
     if ($this->gadwp->config->options['ga_dash_userapi']) {
         $this->client->setClientId($this->gadwp->config->options['ga_dash_clientid']);
         $this->client->setClientSecret($this->gadwp->config->options['ga_dash_clientsecret']);
         $this->client->setDeveloperKey($this->gadwp->config->options['ga_dash_apikey']);
     } else {
         $this->client->setClientId($this->gadwp->config->access[0]);
         $this->client->setClientSecret($this->gadwp->config->access[1]);
         $this->client->setDeveloperKey($this->gadwp->config->access[2]);
     }
     $this->service = new Google_Service_Analytics($this->client);
     if ($this->gadwp->config->options['ga_dash_token']) {
         $token = $this->gadwp->config->options['ga_dash_token'];
         $token = $this->refresh_token();
         if ($token) {
             $this->client->setAccessToken($token);
         }
     }
 }
開發者ID:nilmadhab,項目名稱:webtutplus,代碼行數:41,代碼來源:gapi.php

示例13: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     add_action('admin_bar_menu', array($this, 'custom_adminbar_node'), 999);
 }
開發者ID:crazyyy,項目名稱:octagram,代碼行數:5,代碼來源:item-reports.php

示例14: __construct

 public function __construct()
 {
     $this->gadwp = GADWP();
     // Styles & Scripts
     add_action('wp_enqueue_scripts', array($this, 'load_styles_scripts'));
 }
開發者ID:brstgt,項目名稱:layuda,代碼行數:6,代碼來源:setup.php

示例15: output_sidebar

    public static function output_sidebar()
    {
        global $wp_version;
        $gadwp = GADWP();
        ?>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div id="postbox-container-1" class="postbox-container">
                                                    <div class="meta-box-sortables">
                                                        <div class="postbox">
                                                            <h3>
                                                                <span><?php 
        _e("Setup Tutorial & Demo", 'google-analytics-dashboard-for-wp');
        ?>
</span>
                                                            </h3>
                                                            <div class="inside">
                                                                <a href="https://deconf.com/google-analytics-dashboard-wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=video&utm_campaign=gadwp" target="_blank"><img src="<?php 
        echo plugins_url('images/google-analytics-dashboard.png', __FILE__);
        ?>
" width="100%" alt="" /></a>
                                                            </div>
                                                        </div>
                                                        <div class="postbox">
                                                            <h3>
                                                                <span><?php 
        _e("Follow & Review", 'google-analytics-dashboard-for-wp');
        ?>
</span>
                                                            </h3>
                                                            <div class="inside">
                                                                <div class="gadash-desc">
																	<div style="margin-left:-10px;">
																		<div class="g-page" data-width="273" data-href="//plus.google.com/+Deconfcom" data-layout="landscape" data-showtagline="false" data-showcoverphoto="false" data-rel="publisher"></div>
																	</div>

																	<script type="text/javascript">
																	  (function() {
																	    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
																	    po.src = 'https://apis.google.com/js/platform.js';
																	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
																	  })();
																	</script>
                                                                </div>
                                                                <br />
                                                                <div class="gadash-desc">
                                                                	<a href="https://twitter.com/deconfcom" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @deconfcom</a>
																	<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                                                                </div>
                                                                <br />
                                                                <div class="gadash-title">
                                                                    <a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info"><img src="<?php 
        echo plugins_url('images/star.png', __FILE__);
        ?>
" /></a>
                                                                </div>
                                                                <div class="gadash-desc">
                                                                    <?php 
        printf(__('Your feedback and review are both important, %s!', 'google-analytics-dashboard-for-wp'), sprintf('<a href="http://wordpress.org/support/view/plugin-reviews/google-analytics-dashboard-for-wp#plugin-info">%s</a>', __('rate this plugin', 'google-analytics-dashboard-for-wp')));
        ?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="postbox">
                                                            <h3>
                                                                <span><?php 
        _e("Further Reading", 'google-analytics-dashboard-for-wp');
        ?>
</span>
                                                            </h3>
                                                            <div class="inside">
                                                                <div class="gadash-title">
                                                                    <a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp"><img src="<?php 
        echo plugins_url('images/clicky.png', __FILE__);
        ?>
" /></a>
                                                                </div>
                                                                <div class="gadash-desc">
                                                                    <?php 
        printf(__('%s service with users tracking at IP level.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/clicky-web-analytics-review/?utm_source=gadwp_config&utm_medium=link&utm_content=clicky&utm_campaign=gadwp">%s</a>', __('Web Analytics', 'google-analytics-dashboard-for-wp')));
        ?>
                                                                </div>
                                                                <br />
                                                                <div class="gadash-title">
                                                                    <a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp"><img src="<?php 
        echo plugins_url('images/ssl.png', __FILE__);
        ?>
" /></a>
                                                                </div>
                                                                <div class="gadash-desc">
                                                                    <?php 
        printf(__('%s by moving your website to HTTPS/SSL.', 'google-analytics-dashboard-for-wp'), sprintf('<a href="https://deconf.com/move-website-https-ssl/?utm_source=gadwp_config&utm_medium=link&utm_content=ssl&utm_campaign=gadwp">%s</a>', __('Improve search rankings', 'google-analytics-dashboard-for-wp')));
        ?>
                                                                </div>
                                                                <br />
                                                                <div class="gadash-title">
                                                                    <a href="https://deconf.com/wordpress/?utm_source=gadwp_config&utm_medium=link&utm_content=plugins&utm_campaign=gadwp"><img src="<?php 
        echo plugins_url('images/wp.png', __FILE__);
        ?>
//.........這裏部分代碼省略.........
開發者ID:RagnarDanneskjold,項目名稱:goodbyeloans.com,代碼行數:101,代碼來源:settings.php


注:本文中的GADWP函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。