if (empty($mainUrl)) { $mainUrl = FrameWpf::_()->getModule('adminmenu')->getMainLink(); } return empty($tab) ? $mainUrl : $mainUrl . '&tab=' . $tab; } public function getRolesList() { if (!function_exists('get_editable_roles')) { require_once( ABSPATH . '/wp-admin/includes/user.php' ); } return get_editable_roles(); } public function getAvailableUserRolesSelect() { $rolesList = $this->getRolesList(); $rolesListForSelect = array(); foreach ($rolesList as $rKey => $rData) { $rolesListForSelect[ $rKey ] = $rData['name']; } return $rolesListForSelect; } public function getAll() { if (empty($this->_options)) { $defSendmailPath = @ini_get('sendmail_path'); if ( empty($defSendmailPath) && !stristr($defSendmailPath, 'sendmail') ) { $defSendmailPath = '/usr/sbin/sendmail'; } $this->_options = DispatcherWpf::applyFilters('optionsDefine', array( 'general' => array( 'label' => esc_html__('General', 'woo-product-filter'), 'opts' => array( 'send_stats' => array( 'label' => esc_html__( 'Send usage statistics', 'woo-product-filter'), 'desc' => esc_html__('Send information about what plugin options you prefer to use, this will help us make our solution better for You.', 'woo-product-filter'), 'def' => '0', 'html' => 'checkboxHiddenVal' ), 'count_product_shop' => array( 'label' => esc_html__( 'Set number of displayed products', 'woo-product-filter'), 'desc' => esc_html__('Set number of displayed products. Leave blank for the default value.', 'woo-product-filter'), 'def' => '', 'html' => 'input' ), 'move_sidebar' => array( 'label' => esc_html__( 'Move Sidebar To Top For Mobile', 'woo-product-filter'), 'desc' => esc_html__('Turn on if you want the sidebar to appear above content on mobile devices. Some themes do not have blocks required for this option.', 'woo-product-filter'), 'def' => '0', 'html' => 'checkboxHiddenVal' ), 'not_found_products_message' => array( 'label' => esc_html__( 'Display a message about not found products', 'woo-product-filter'), 'desc' => esc_html__('If no products were found, display a message about it', 'woo-product-filter'), 'def' => '0', 'html' => 'checkboxHiddenVal' ), 'content_accessibility' => array( 'label' => esc_html__( 'Generate HTML based on WCAG standards', 'woo-product-filter' ), 'desc' => esc_html__( 'Use Web Content Accessibility Guidelines', 'woo-product-filter' ), 'def' => '0', 'html' => 'checkboxHiddenVal', ), 'disable_clean_rocket_cache' => array( 'label' => esc_html__( 'Disable clearing WP Rocket cache', 'woo-product-filter' ), 'desc' => esc_html__( 'Disable clearing WP Rocket cache by saving filter settings', 'woo-product-filter' ), 'def' => '0', 'html' => 'checkboxHiddenVal', ), 'disable_plugin_sorting' => array( 'label' => esc_html__( 'Disable plugin sorting', 'woo-product-filter' ), 'desc' => esc_html__( 'If this option is enabled, then the Product Filter by WBW will not use its sorting functionality. Woocommerce or other plugins sorting algorithms will be used.', 'woo-product-filter' ), 'def' => '0', 'html' => 'checkboxHiddenVal', ), 'index_group_bundle' => array( 'label' => esc_html__( 'Indexing stockstatus for Grouped+Bundle Products', 'woo-product-filter' ), 'desc' => esc_html__( 'If you have groupped products and have bundle products in them and you go to properly index the stockstatus of these groupped products, then enable this option. Attention: enable this option only if it is really necessary, as it can significantly slow down the indexing process.', 'woo-product-filter' ), 'def' => '0', 'html' => 'checkboxHiddenVal', ), ), ), )); $isPro = FrameWpf::_()->getModule('promo')->isPro(); foreach ($this->_options as $catKey => $cData) { foreach ($cData['opts'] as $optKey => $opt) { $this->_optionsToCategoires[ $optKey ] = $catKey; if (isset($opt['pro']) && !$isPro) { $this->_options[ $catKey ]['opts'][ $optKey ]['pro'] = FrameWpf::_()->getModule('promo')->generateMainLink('utm_source=plugin&utm_medium=' . $optKey . '&utm_campaign=popup'); } } } $this->getModel()->fillInValues( $this->_options ); } return $this->_options; } public function getFullCat( $cat ) { $this->getAll(); return isset($this->_options[ $cat ]) ? $this->_options[ $cat ] : false; } public function getCatOpts( $cat ) { $opts = $this->getFullCat($cat); return $opts ? $opts['opts'] : false; } }