Changeset 1426244
- Timestamp:
- 05/29/2016 06:01:36 AM (10 years ago)
- Location:
- ownerauthor-ad-split-for-genesis/trunk
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
admin/Global_Settings.php (modified) (5 diffs)
-
admin/Post_Metabox.php (modified) (3 diffs)
-
admin/User_Profile_Setting.php (modified) (1 diff)
-
adsense-owner-author-split.php (modified) (1 diff)
-
includes/Main.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ownerauthor-ad-split-for-genesis/trunk
-
Property
svn:ignore
set to
deploy.sh
README.md
.git
.gitignore
-
Property
svn:ignore
set to
-
ownerauthor-ad-split-for-genesis/trunk/admin/Global_Settings.php
r1422584 r1426244 119 119 add_meta_box( 'aoas_default_settings', __( 'Defaults', 'adsense_owner_author_split' ), array( $this, 'default_settings' ), $this->pagehook, 'main' ); 120 120 add_meta_box( 'aoas_above_ad_settings', __( 'Above-Content Ad', 'adsense_owner_author_split' ), array( $this, 'above_ad' ), $this->pagehook, 'main' ); 121 add_meta_box( 'aoas_shortcode_ad_settings', __( 'Content Ad', 'adsense_owner_author_split' ), array( $this, 'shortcode_ad' ), $this->pagehook, 'main' ); 121 122 add_meta_box( 'aoas_below_ad_settings', __( 'Below-Content Ad', 'adsense_owner_author_split' ), array( $this, 'below_ad' ), $this->pagehook, 'main' ); 122 add_meta_box( 'aoas_shortcode_ad_settings', __( 'Shortcode Ad', 'adsense_owner_author_split' ), array( $this, 'shortcode_ad' ), $this->pagehook, 'main' );123 123 } 124 124 … … 172 172 173 173 <tr valign="top"> 174 <th scope="row"><label for="owner_above_adsense_code"><?php _e( 'Above-Content Ad senseCode', 'adsense_owner_author_split' ); ?></label></th>174 <th scope="row"><label for="owner_above_adsense_code"><?php _e( 'Above-Content Ad Code', 'adsense_owner_author_split' ); ?></label></th> 175 175 <td> 176 176 <p><textarea name="<?php echo $this->get_field_name( 'owner_above_adsense_code' ); ?>" class="regular-text" id="owner_above_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_above_adsense_code' ) ); ?></textarea></p> … … 193 193 194 194 /** 195 * Build the fields for the shortcode ad metabox 196 * 197 * @since 1.0.0 198 * @access public 199 */ 200 public function shortcode_ad() { 201 202 $shortcode = '<code>[gb_ad]</code>'; 203 ?> 204 205 <table class="form-table"> 206 <tbody> 207 208 <tr valign="top"> 209 <th scope="row"><label for="owner_shortcode_adsense_code"><?php _e( 'Content Ad Code', 'adsense_owner_author_split' ); ?></label></th> 210 <td> 211 <p><textarea name="<?php echo $this->get_field_name( 'owner_shortcode_adsense_code' ); ?>" class="regular-text" id="owner_shortcode_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_adsense_code' ) ); ?></textarea></p> 212 </td> 213 </tr> 214 215 <tr valign="top"> 216 <th scope="row"><label for="owner_shortcode_weight"><?php _e( 'Weight', 'adsense_owner_author_split' ); ?></label></th> 217 <td> 218 <p><input type="range" min="0" max="10" step="1" name="<?php echo $this->get_field_name( 'owner_shortcode_weight' ); ?>" class="regular-text" id="owner_shortcode_weight" value="<?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?>" oninput="outputUpdate('#owner_shortcode_weight_output', value)" /></p> 219 <p class="description">Show the Owner's ad in the shortcode for every <strong><output for="owner_shortcode_weight" id="owner_shortcode_weight_output"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?></output></strong> out of 10 page loads</p> 220 </td> 221 </tr> 222 223 <tr valign="top"> 224 <th scope="row"></th> 225 <td> 226 <p class="description"><?php printf( esc_html__( 'Include content ad within your content by using the %s shortcode', 'adsense_owner_author_split' ), $shortcode ); ?></p> 227 </td> 228 </tr> 229 230 </tbody> 231 </table> 232 233 <?php 234 } 235 236 /** 195 237 * Build the fields for the below ad metabox 196 238 * … … 204 246 205 247 <tr valign="top"> 206 <th scope="row"><label for="owner_below_adsense_code"><?php _e( 'Below-Content Ad senseCode', 'adsense_owner_author_split' ); ?></label></th>248 <th scope="row"><label for="owner_below_adsense_code"><?php _e( 'Below-Content Ad Code', 'adsense_owner_author_split' ); ?></label></th> 207 249 <td> 208 250 <p><textarea name="<?php echo $this->get_field_name( 'owner_below_adsense_code' ); ?>" class="regular-text" id="owner_above_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_below_adsense_code' ) ); ?></textarea></p> … … 219 261 220 262 </tbody> 221 </table> 222 223 <?php 224 } 225 226 /** 227 * Build the fields for the shortcode ad metabox 228 * 229 * @since 1.0.0 230 * @access public 231 */ 232 public function shortcode_ad() { ?> 233 234 <table class="form-table"> 235 <tbody> 236 237 <tr valign="top"> 238 <th scope="row"><label for="owner_shortcode_adsense_code"><?php _e( 'Shortcode Adsense Code', 'adsense_owner_author_split' ); ?></label></th> 239 <td> 240 <p><textarea name="<?php echo $this->get_field_name( 'owner_shortcode_adsense_code' ); ?>" class="regular-text" id="owner_shortcode_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_adsense_code' ) ); ?></textarea></p> 241 </td> 242 </tr> 243 244 <tr valign="top"> 245 <th scope="row"><label for="owner_shortcode_weight"><?php _e( 'Weight', 'adsense_owner_author_split' ); ?></label></th> 246 <td> 247 <p><input type="range" min="0" max="10" step="1" name="<?php echo $this->get_field_name( 'owner_shortcode_weight' ); ?>" class="regular-text" id="owner_shortcode_weight" value="<?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?>" oninput="outputUpdate('#owner_shortcode_weight_output', value)" /></p> 248 <p class="description">Show the Owner's ad in the shortcode for every <strong><output for="owner_shortcode_weight" id="owner_shortcode_weight_output"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?></output></strong> out of 10 page loads</p> 249 </td> 250 </tr> 251 252 </tbody> 263 253 264 </table> 254 265 -
ownerauthor-ad-split-for-genesis/trunk/admin/Post_Metabox.php
r1422584 r1426244 44 44 return; 45 45 46 add_meta_box( 'gb_post_ad_control', __( 'A dsense Owner/Author Split', 'adsense-owner-author-split' ), array( $this, 'metabox_options' ), 'post', 'side', 'high' );46 add_meta_box( 'gb_post_ad_control', __( 'Automatic Ad Blocks', 'adsense-owner-author-split' ), array( $this, 'metabox_options' ), 'post', 'side', 'high' ); 47 47 } 48 48 … … 80 80 <label for="gb_adsense_hide_content_ads"> 81 81 <select name="gb_adsense_hide_content_ads" id="gb_adsense_hide_content_ads" default=""> 82 <option value="show-ads" <?php echo ( $show_selected ) ? 'selected' : ''; ?>> Show Ads on Post</option>83 <option value="hide-ads" <?php echo ( $hide_selected ) ? 'selected' : ''; ?>> Hide Ads on Post</option>82 <option value="show-ads" <?php echo ( $show_selected ) ? 'selected' : ''; ?>><?php _e( 'Show Automatic Ads on Post', 'adsense-owner-author-split' ); ?></option> 83 <option value="hide-ads" <?php echo ( $hide_selected ) ? 'selected' : ''; ?>><?php _e( 'Hide Automatic Ads on Post', 'adsense-owner-author-split' ); ?></option> 84 84 </select> 85 85 </label> 86 </p> 87 </td> 88 </tr> 89 90 <tr valign="top"> 91 <td> 92 <p class="description"> 93 <?php 94 _e( 'This option determines whether the automatic above and below content ads will display on this post', 'adsense-owner-author-split' ); 95 ?> 96 </p> 97 </td> 98 </tr> 99 100 <tr valign="top"> 101 <td> 102 <p> 103 <?php $this->update_ad_codes(); ?> 86 104 </p> 87 105 </td> … … 120 138 } 121 139 140 /** 141 * Prompt users that can save their profile ads to include them 142 * if they haven't been added yet 143 * 144 * @since 1.1.0 145 * @access public 146 */ 147 public function update_ad_codes() { 148 149 if( ! current_user_can( 'unfiltered_html' ) ) 150 return; 151 152 $profile_link = get_edit_user_link( get_current_user_id() ); 153 154 echo '<a href="' . $profile_link . '#aoas-profile-settings" target="_blank">' . __( 'Update Your Ad Codes', 'adsense-owner-author-split') . '</a>'; 155 156 } 157 122 158 } -
ownerauthor-ad-split-for-genesis/trunk/admin/User_Profile_Setting.php
r1422584 r1426244 41 41 public static function user_meta( $user ) { ?> 42 42 43 <h3 ><?php echo __( 'Adsense Owner/Author Split', 'adsense_owner_author_split' ); ?></h3>43 <h3 id="aoas-profile-settings"><?php echo __( 'Adsense Owner/Author Split', 'adsense_owner_author_split' ); ?></h3> 44 44 45 45 <table class="form-table"> -
ownerauthor-ad-split-for-genesis/trunk/adsense-owner-author-split.php
r1422584 r1426244 7 7 * Plugin URI: https://github.com/BeardedGinger/adsense-owner-author-split 8 8 * Description: Built specifically for use with the Genesis Framework, split ad space with post author and set how often your ad displays vs the post author's ad 9 * Version: 1. 0.09 * Version: 1.1.0 10 10 * Author: Josh Mallard 11 11 * Author URI: http://gingercult.com -
ownerauthor-ad-split-for-genesis/trunk/includes/Main.php
r1422584 r1426244 58 58 require plugin_dir_path( __FILE__ ) . 'Content_Ads.php'; 59 59 60 add_action( 'genesis_entry_content', array( $this, 'before_content_ad' ), 0);61 add_action( 'genesis_entry_content', array( $this, 'below_content_ad' ), 10);60 add_action( 'genesis_entry_content', array( $this, 'before_content_ad' ), apply_filters( 'above_content_ad_priority', 0 ) ); 61 add_action( 'genesis_entry_content', array( $this, 'below_content_ad' ), apply_filters( 'below_content_ad_priority', 10 ) ); 62 62 63 63 } -
ownerauthor-ad-split-for-genesis/trunk/readme.txt
r1423606 r1426244 5 5 Requires at least: 4.2 6 6 Tested up to: 4.5.2 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 53 53 54 54 Set the site owner ads and display weight 55 Set the post author ads on their profile page 55 Set the post author ads on their profile page 56 56 57 57 == Changelog == 58 59 = 1.1.0 = 60 * Update shortcode ad wording to "Content Ad" 61 * Added shortcode reference to global settings page 62 * Update title and wording on postmeta box 63 * Made select options on postmeta box translatable 64 * Added post metabox prompt to update ad codes 65 * Added filters (above_content_ad_priority and below_content_ad_priority) for changing the priority on the automatic content ads 58 66 59 67 = 1.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.