Нет описания

class-pum-form.php 781B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // Exit if accessed directly
  3. if ( ! defined( 'ABSPATH' ) ) {
  4. exit;
  5. }
  6. class PUM_Form extends PUM_Fields {
  7. public $id;
  8. public $field_prefix = 'pum_form';
  9. public $field_name_format = '{$prefix}[{$field}]';
  10. /**
  11. * Sets the $id of the Cookie and returns the parent __construct()
  12. *
  13. * @param array $id
  14. * @param array $args
  15. */
  16. public function __construct( $id, $args = array() ) {
  17. $this->id = $id;
  18. if ( empty( $args['id'] ) ) {
  19. $args['id'] = $id;
  20. }
  21. if ( isset( $args['field_prefix'] ) ) {
  22. $this->field_prefix = $args['field_prefix'];
  23. }
  24. if ( isset( $args['field_name_format'] ) ) {
  25. $this->field_name_format = $args['field_name_format'];
  26. }
  27. return parent::__construct( $args );
  28. }
  29. public function get_id() {
  30. return $this->id;
  31. }
  32. }