コード例 #1
0
 /**
  * Auto updater
  *
  * @access  private
  * @return  void
  */
 public function auto_updater()
 {
     $betas = edd_get_option('enabled_betas', array());
     $args = array('version' => $this->version, 'license' => $this->license, 'author' => $this->author, 'beta' => edd_extension_has_beta_support($this->item_shortname));
     if (!empty($this->item_id)) {
         $args['item_id'] = $this->item_id;
     } else {
         $args['item_name'] = $this->item_name;
     }
     // Setup the updater
     $edd_updater = new EDD_SL_Plugin_Updater($this->api_url, $this->file, $args);
 }
コード例 #2
0
/**
 * Display beta opt-ins
 *
 * @since       2.6.11
 * @return      void
 */
function edd_tools_betas_display()
{
    if (!current_user_can('manage_shop_settings')) {
        return;
    }
    $has_beta = edd_get_beta_enabled_extensions();
    do_action('edd_tools_betas_before');
    ?>

	<div class="postbox edd-beta-support">
		<h3><span><?php 
    _e('Enable Beta Versions', 'easy-digital-downloads');
    ?>
</span></h3>
		<div class="inside">
			<p><?php 
    _e('Checking any of the below checkboxes will opt you in to receive pre-release update notifications. You can opt-out at any time. Pre-release updates do not install automatically, you will still have the opportunity to ignore update notifications.', 'easy-digital-downloads');
    ?>
</p>
			<form method="post" action="<?php 
    echo admin_url('edit.php?post_type=download&page=edd-tools&tab=betas');
    ?>
">
				<table class="form-table edd-beta-support">
					<tbody>
						<?php 
    foreach ($has_beta as $slug => $product) {
        ?>
							<tr>
								<?php 
        $checked = edd_extension_has_beta_support($slug);
        ?>
								<th scope="row"><?php 
        echo esc_html($product);
        ?>
</th>
								<td>
									<input type="checkbox" name="enabled_betas[<?php 
        echo esc_attr($slug);
        ?>
]" id="enabled_betas[<?php 
        echo esc_attr($slug);
        ?>
]"<?php 
        echo $checked;
        ?>
 value="1" />
									<label for="enabled_betas[<?php 
        echo esc_attr($slug);
        ?>
]"><?php 
        printf(__('Get updates for pre-release versions of %s', 'easy-digital-downloads'), $product);
        ?>
</label>
								</td>
							</tr>
						<?php 
    }
    ?>
					</tbody>
				</table>
				<input type="hidden" name="edd_action" value="save_enabled_betas" />
				<?php 
    wp_nonce_field('edd_save_betas_nonce', 'edd_save_betas_nonce');
    ?>
				<?php 
    submit_button(__('Save', 'easy-digital-downloads'), 'secondary', 'submit', false);
    ?>
			</form>
		</div>
	</div>

	<?php 
    do_action('edd_tools_betas_after');
}