Exemple #1
0
 /**
  * Return Tweet button parameters suitable
  *
  * @since 1.0.0
  *
  * @return array Tweet button parameter array {
  *   @type string dashed parameter name
  *   @type string parameter value
  * }
  */
 public function toArray()
 {
     $data = parent::toArray();
     if ($this->size) {
         $data['size'] = $this->size;
     }
     // empty string is default value
     if ($this->count) {
         $data['count'] = $this->count;
     }
     // only include counturl if a count will be shown
     if ('none' !== $this->count && $this->counturl) {
         $data['counturl'] = $this->counturl;
     }
     if ($this->align) {
         $data['align'] = $this->align;
     }
     return $data;
 }
Exemple #2
0
 /**
  * Convert the class object into an array, removing default field values
  *
  * @since 1.0.0
  *
  * @return array properties as associative array
  */
 public function toArray()
 {
     $data = parent::toArray();
     if (false === $this->show_screen_name) {
         $data['show-screen-name'] = 'false';
     }
     if (false === $this->show_count) {
         $data['show-count'] = 'false';
     }
     if ($this->size && 'medium' !== $this->size) {
         $data['size'] = $this->size;
     }
     return $data;
 }
Exemple #3
0
 /**
  * Return Tweet button parameters suitable
  *
  * @since 1.0.0
  *
  * @return array Tweet button parameter array {
  *   @type string dashed parameter name
  *   @type string parameter value
  * }
  */
 public function toArray()
 {
     $data = parent::toArray();
     if ($this->size) {
         $data['size'] = $this->size;
     }
     return $data;
 }
 /**
  * Convert the class object into an array, removing default field values
  *
  * @since 1.3.0
  *
  * @return array properties as associative array
  */
 public function toArray()
 {
     $data = parent::toArray();
     if ($this->size && static::DEFAULT_SIZE !== $this->size) {
         $data['size'] = $this->size;
     }
     return $data;
 }