addons_admin_url ) { $sf = new WOSettings( AdCommander::ns() ); $this->addons_admin_url = $sf->get_tab_url( $sf->key( 'addons' ), Admin::settings_admin_url() ); } return $this->addons_admin_url; } /** * The EDD Pro license name. * * This is included here instead of Pro, because if it changes in a future we can push an update to the public repo. * Then Pro could update from the private repo using the correct name. */ public static function edd_item_name() { return 'Ad Commander Pro'; } /** * Is the pro license added? * * @return bool */ public function is_pro_license_added() { if ( $this->is_pro_loaded() ) { return License::instance()->is_pro_license_added(); } return false; } /** * Get the pro license status. * * @return bool|string */ public function pro_license_status( $refresh = false ) { if ( $this->is_pro_loaded() ) { return License::instance()->license_status( $refresh ); } return false; } /** * Enqueue script data for the license settings page. * * @param string $status The status to pass to the data. * * @return void */ public function enqueue_pro_license_script_data( $status ) { if ( $this->is_pro_loaded() ) { $admin_license = new AdminLicense(); $admin_license->enqueue_script_data( $status ); } } /** * Reset the pro license status. * * @param bool $hard Hard reset or not. * @param bool $pending Reset to pending or not. * * @return void */ public function pro_license_reset_status( $hard = true, $pending = false ) { if ( $this->is_pro_loaded() ) { License::instance()->reset_status( $hard ); if ( $pending ) { License::instance()->reset_status_to_pending(); } } } /** * Deactivate the license key. * * @param mixed $license_key The license key, if one exists. * * @return void */ public function pro_license_deactivate( $license_key ) { if ( $this->is_pro_loaded() ) { License::instance()->deactivate_license( $license_key ); } } /** * Group modes tha require Pro. * * @return array */ public function pro_group_modes() { return array( 'grid' ); } /** * Placement positions that require pro. * * @return array */ public function pro_placement_positions() { return array( 'within_content', 'post_list', 'above_title', 'after_p_tag' ); } /** * These conditions are only usable if Pro is installed. * * @return array */ public function pro_visitor_conditions() { /** * All conditions except 'logged in' */ $targets = array_keys( TargetingMeta::allowed_visitor_targets() ); unset( $targets['logged_in'] ); return $targets; } /** * These group ordering methods are only usable if Pro is installed. * * @return array */ public function pro_group_order_methods() { return array( 'weighted', 'sequential' ); } /** * The label appended to featurs that require pro. * * @return string */ public static function pro_label() { /* translators: This text is appended to features that are only included in the pro version. Leading spacing and hyphen (or equivalent) should be included. */ return __( ' - Pro Add-on', 'ad-commander' ); } }