ReduxFramework_extension_locked

Main ReduxFramework custom_field extension class.

Defined (1)

The class is defined in the following location(s).

/library/admin/redux-extensions/extensions/locked/extension_locked.php  
  1. class ReduxFramework_extension_locked extends ReduxFramework { 
  2.  
  3. // Protected vars 
  4. protected $parent; 
  5. public $_extension_url; 
  6. public $_extension_dir; 
  7. public static $theInstance; 
  8. public static $version = "2.0.0"; 
  9.  
  10. public 
  11.  
  12. /** 
  13. * Class Constructor. Defines the args for the extions class 
  14. * @since 1.0.0 
  15. * @access public 
  16. * @param array $sections Panel sections. 
  17. * @param array $args Class constructor arguments. 
  18. * @param array $extra_tabs Extra panel tabs. 
  19. * @return void 
  20. */ 
  21. function __construct($parent) { 
  22.  
  23. $this->parent = $parent; 
  24. if (empty($this->_extension_dir)) { 
  25. $this->_extension_dir = trailingslashit(str_replace('\\', '/', dirname(__FILE__))); 
  26. $this->_extension_url = site_url(str_replace(trailingslashit(str_replace('\\', '/', ABSPATH)), '', $this->_extension_dir)); 
  27.  
  28. self::$theInstance = $this; 
  29.  
  30. add_filter("redux/field/{$this->parent->args['opt_name']}/render/after", array( 
  31. $this,  
  32. 'check_locked_field' 
  33. ), 1, 2); 
  34.  
  35. add_filter("redux/page/{$this->parent->args['opt_name']}/section/before", array( 
  36. $this,  
  37. 'check_locked_section' 
  38. )); 
  39.  
  40. add_action("redux/page/{$this->parent->args['opt_name']}/enqueue", array($this, 'enqueue')); 
  41.  
  42. public function check_locked_field($render, $field) { 
  43. if (isset($field['locked']) && $field['locked']) { 
  44. global $pagenow; 
  45. $message = ""; 
  46. if ($field['locked'] !== true && $pagenow != "customize.php") { 
  47. $message = $field['locked']; 
  48. $t4p_url = esc_url("https://theme4press.com/"); 
  49. $render = '<div class="redux-field-locked"><div class="redux-locked-inner' . (empty($message) ? ' empty' : '') . '"><a target="_blank" href="' . $t4p_url . 'evolve-multipurpose-wordpress-theme/" class="el el-lock"> </a>' . $message . '</div></div>' . $render; 
  50. return $render; 
  51.  
  52. public function check_locked_section($section) { 
  53. if (isset($section['locked']) && $section['locked']) { 
  54. $message = ""; 
  55. if ($section['locked'] !== true) { 
  56. $message = $section['locked']; 
  57. echo '<div class="redux-section-locked"><div class="redux-locked-inner' . (empty($message) ? ' empty' : '') . '"><div class="el el-lock"> </div>' . $message . '</div></div>'; 
  58.  
  59. public function getInstance() { 
  60. return self::$theInstance; 
  61.  
  62. public function enqueue() { 
  63. wp_enqueue_style( 
  64. 'redux-locked-css', $this->_extension_url . 'extension_locked.css', array(), ReduxFramework_extension_locked::$version, 'all' 
  65. ); 
  66.