ReduxFramework_import_button

Main ReduxFramework_custom_field class.

Defined (1)

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

/library/admin/redux-extensions/extensions/import_button/import_button/field_import_button.php  
  1. class ReduxFramework_import_button extends ReduxFramework { 
  2.  
  3. /** 
  4. * Field Constructor. 
  5. * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function 
  6. * @since 1.0.0 
  7. * @access public 
  8. * @return void 
  9. */ 
  10. function __construct($field = array(), $value = '', $parent) { 
  11.  
  12. $this->parent = $parent; 
  13. $this->field = $field; 
  14. $this->value = $value; 
  15. $this->extension = ReduxFramework_extension_import_button::getInstance(); 
  16.  
  17. // Set default args for this field to avoid bad indexes. Change this to anything you use. 
  18. $defaults = array( 
  19. 'options' => array(),  
  20. 'stylesheet' => '',  
  21. 'output' => true,  
  22. 'enqueue' => true,  
  23. 'enqueue_frontend' => true 
  24. ); 
  25. $this->field = wp_parse_args($this->field, $defaults); 
  26.  
  27. /** 
  28. * Field Render Function. 
  29. * Takes the vars and outputs the HTML for the field in the settings 
  30. * @since 1.0.0 
  31. * @access public 
  32. * @return void 
  33. */ 
  34. public function render() { 
  35.  
  36. echo "<button class='button button-primary import_demo_content_button' href='" . admin_url('themes.php?page=evl_options_options') . "&import_data_content=true" . "'>Import Demo Content</button>"; 
  37.  
  38. /** 
  39. * Enqueue Function. 
  40. * If this field requires any scripts, or css define this function and register/enqueue the scripts/css 
  41. * @since 1.0.0 
  42. * @access public 
  43. * @return void 
  44. */ 
  45. public function enqueue() { 
  46.  
  47. wp_enqueue_script( 
  48. 'redux-field-import-button-js', "{$this->extension->_extension_url}{$this->extension->field_name}/field_import_button.js", array('jquery'), time(), true 
  49. ); 
  50.  
  51. /** 
  52. * Output Function. 
  53. * Used to enqueue to the front-end 
  54. * @since 1.0.0 
  55. * @access public 
  56. * @return void 
  57. */ 
  58. public function output() { 
  59.  
  60. if ($this->field['enqueue_frontend']) { 
  61.  
  62.