get_textarea() public method

Get rtmedia html textarea in admin options.
public get_textarea ( string/array $attributes = '' ) : string
$attributes string/array
return string
Ejemplo n.º 1
0
 /**
  * Show rtmedia textarea in admin options.
  *
  * @access static
  *
  * @param  array $args
  * @param  bool  $echo
  *
  * @return string $chkObj->get_textarea( $args )
  */
 public static function textarea($args, $echo = true)
 {
     global $rtmedia;
     $options = $rtmedia->options;
     $defaults = array('key' => '', 'desc' => '', 'show_desc' => false);
     $args = wp_parse_args($args, $defaults);
     extract($args);
     if (!isset($value)) {
         trigger_error(__('Please provide a "value" in the argument.', 'rtmedia'));
         return;
     }
     if (!empty($key)) {
         $args['name'] = 'rtmedia-options[' . $key . ']';
     }
     $args['rtForm_options'] = array(array('' => 1, 'checked' => $value));
     $chkObj = new rtForm();
     if ($echo) {
         echo $chkObj->get_textarea($args);
     } else {
         return $chkObj->get_textarea($args);
     }
 }
Ejemplo n.º 2
0
 /**
  * Show rtmedia textarea in admin options.
  *
  * @access static
  *
  * @param  array $args
  * @param  bool $echo
  *
  * @return string $chkObj->get_textarea( $args )
  */
 public static function textarea($args, $echo = true)
 {
     $defaults = array('key' => '', 'desc' => '', 'show_desc' => false);
     $args = wp_parse_args($args, $defaults);
     extract($args);
     if (!isset($value)) {
         trigger_error(esc_html__('Please provide a "value" in the argument.', 'buddypress-media'));
         return;
     }
     if (!empty($key)) {
         $args['name'] = 'rtmedia-options[' . $key . ']';
     }
     $args['rtForm_options'] = array(array('' => 1, 'checked' => $value));
     $chkObj = new rtForm();
     if ($echo) {
         $chkObj->display_textarea($args);
     } else {
         return $chkObj->get_textarea($args);
         // @codingStandardsIgnoreLine
     }
     return;
 }