Caldera_Forms_Admin_APEasyQueries

Add auto-populate option for Easy Queries to select fields.

Defined (1)

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

/classes/admin/apeasyqueries.php  
  1. class Caldera_Forms_Admin_APEasyQueries extends Caldera_Forms_Admin_APSetup { 
  2.  
  3. /** 
  4. * @inheritdoc 
  5. */ 
  6. public function add_type() { 
  7. if( defined( 'CAEQ_PATH' ) ) { 
  8. printf( '<option value="easy-query"{{#is auto_type value="easy-query"}} selected="selected"{{/is}}>%s</option>', esc_html__( 'Easy Query', 'caldera-forms' ) ); 
  9.  
  10. /** 
  11. * @inheritdoc 
  12. */ 
  13. public function add_options() { 
  14. if( ! defined( 'CAEQ_PATH' ) ) { 
  15. return; 
  16. $easy_queries = \calderawp\caeq\options::get_registry(); 
  17. ?> 
  18. <div class="caldera-config-group caldera-config-group-auto-easy-query auto-populate-type-panel" style="display:none;"> 
  19. <label for="cf-auto-populate-easy-queries"> 
  20. <?php esc_html_e( 'Easy Queries', 'caldera-forms' ); ?> 
  21. </label> 
  22. <div class="caldera-config-field"> 
  23. <select id="cf-auto-populate-easy-queries" class="block-input field-config" name="{{_name}}[easy-query]">"; 
  24. <?php 
  25. foreach( $easy_queries as $easy_query ) { 
  26. printf( '<option value="%s" {{#is easy-query value="%s"}}selected="selected"{{/is}}>%s</option>',  
  27. esc_attr( $easy_query[ 'id' ] ), esc_attr( $easy_query[ 'id' ] ), esc_html__( $easy_query[ 'name' ] )); 
  28.  
  29. ?></select> 
  30.  
  31. </div> 
  32. </div> 
  33. <?php 
  34.