Plugin Directory

Changeset 2007350


Ignore:
Timestamp:
01/06/2019 11:44:14 PM (7 years ago)
Author:
albreis
Message:

Add settings page and Ads configuration option

Location:
albnet-shortcodes/trunk
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • albnet-shortcodes/trunk/README.txt

    r2007329 r2007350  
    128128= What kind of support do you provide? =
    129129
     130== Screenshots ==
     131
     1321. Clean layout for posts
     133
    130134== Changelog ==
    131135
     
    1341381.0.1 Add docs for shortcode options in installation instructions
    135139
    136 == Screenshots ==
    137 
    138 1. Clean layout for posts
     1401.1.1 Add settings page and Ads configuration option
  • albnet-shortcodes/trunk/albnet-shortcodes.php

    r2007329 r2007350  
    1212 * Plugin URI: https://shortcodes.albreis.com.br
    1313 * Description: A lot of shortcodes to show posts
    14  * Version: 1.0.1
     14 * Version: 1.0.2
    1515 * Author: Albreis Network <[email protected]>
    1616 * Author URI: https://albreis.com.br
     
    2121 */
    2222
    23 register_activation_hook( __FILE__, 'albnet_shortcode_activate' );
    24 function albnet_shortcode_activate(){
    25 
    26     // Require parent plugin
    27     if ( ! is_plugin_active( 'advanced-custom-fields/acf.php' ) && current_user_can( 'activate_plugins' ) ) {
    28         // Stop activation redirect and show error
    29         wp_die('Sorry, but this plugin requires the Advanced Custom Fields to be installed and active. <br><a href="' . admin_url( 'plugins.php' ) . '">&laquo; Return to Plugins</a>');
    30     }
    31 }
     23/**
     24 * Load settings page
     25 */
     26require 'settings/init.php';
     27
     28/**
     29 * Add admin menu
     30 */
     31add_action( 'admin_menu', function(){
     32   
     33  add_menu_page( 'Albnet Shortcodes', 'Albnet Shortcodes', 'publish_posts', 'albnet_shortcodes', function(){
     34    require 'settings/index.php';
     35  }, 'dashicons-schedule', 0 );
     36
     37} );
     38
    3239
    3340/**
  • albnet-shortcodes/trunk/shortcode-archive.php

    r2007320 r2007350  
    4141                    </div>
    4242                    <?php if($a['show_ads'] && ($index % $a['ads_step']) == 0): ?>
    43                         <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    44                         <!-- Cabeçalho Portal CM7 -->
    45                         <ins class="adsbygoogle" data-ad-client="ca-pub-5540064341177737" data-ad-slot="9742088570"></ins>
    46                         <script>
    47                         (adsbygoogle = window.adsbygoogle || []).push({});
    48                         </script>
     43                        <div class="albnet-shortcode-ads"><?php echo get_option('albnet_shortcodes_ads_code'); ?></div>
    4944                    <?php endif; $index++; ?>
    5045                </div>
  • albnet-shortcodes/trunk/shortcode-card.php

    r2007320 r2007350  
    6666            </div>
    6767            <?php if($a['show_ads'] && ($index % $a['ads_step']) == 0): ?>
    68                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    69                 <!-- Cabeçalho Portal CM7 -->
    70                 <ins class="adsbygoogle" data-ad-client="ca-pub-5540064341177737" data-ad-slot="9742088570"></ins>
    71                 <script>
    72                 (adsbygoogle = window.adsbygoogle || []).push({});
    73                 </script>
     68                <div class="albnet-shortcode-ads"><?php echo get_option('albnet_shortcodes_ads_code'); ?></div>
    7469            <?php endif; $index++; ?>
    7570        <?php } ?>
  • albnet-shortcodes/trunk/shortcode-horizontal.php

    r2007320 r2007350  
    6767            </div>
    6868            <?php if($a['show_ads'] && ($index % $a['ads_step']) == 0): ?>
    69                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    70                 <!-- Cabeçalho Portal CM7 -->
    71                 <ins class="adsbygoogle" data-ad-client="ca-pub-5540064341177737" data-ad-slot="9742088570"></ins>
    72                 <script>
    73                 (adsbygoogle = window.adsbygoogle || []).push({});
    74                 </script>
     69                <div class="albnet-shortcode-ads"><?php echo get_option('albnet_shortcodes_ads_code'); ?></div>
    7570            <?php endif; $index++; ?>
    7671        <?php } ?>
  • albnet-shortcodes/trunk/shortcode-slideshow.php

    r2007320 r2007350  
    4949        <!--ul class="uk-slideshow-nav uk-dotnav uk-flex-center"></ul-->
    5050    </div>
     51    <?php if($a['show_ads']): ?>
     52        <div class="albnet-shortcode-ads"><?php echo get_option('albnet_shortcodes_ads_code'); ?></div>
     53    <?php endif; ?>
    5154    <?php } wp_reset_postdata(); ?>
    5255</div>
Note: See TracChangeset for help on using the changeset viewer.