| 1 | <?php |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 2 | /** |
||
| 3 | * @author Podlove <[email protected]> |
||
| 4 | * @copyright Copyright (c) 2014-2018, Podlove |
||
| 5 | * @license https://github.com/podlove/podlove-subscribe-button-wp-plugin/blob/master/LICENSE MIT |
||
| 6 | * @package Podlove\PodloveSubscribeButton |
||
| 7 | */ |
||
| 8 | |||
| 9 | namespace PodloveSubscribeButton; |
||
| 10 | |||
| 11 | class Defaults { |
||
|
0 ignored issues
–
show
|
|||
| 12 | |||
| 13 | static function button( $property ) { |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
It is recommend to declare an explicit visibility for
button.
Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed. If you are not sure which visibility to choose, it is a good idea to start with
the most restrictive visibility, and then raise visibility as needed, i.e.
start with Loading history...
|
|||
| 14 | |||
| 15 | $style = array( |
||
| 16 | 'filled' => __( 'Filled', 'podlove-subscribe-button' ), |
||
| 17 | 'outline' => __( 'Outline', 'podlove-subscribe-button' ), |
||
| 18 | 'frameless' => __( 'Frameless', 'podlove-subscribe-button' ), |
||
| 19 | ); |
||
| 20 | |||
| 21 | $format = array( |
||
| 22 | 'rectangle' => __( 'Rectangle', 'podlove-subscribe-button' ), |
||
| 23 | 'square' => __( 'Square', 'podlove-subscribe-button' ), |
||
| 24 | 'cover' => __( 'Cover', 'podlove-subscribe-button' ), |
||
| 25 | ); |
||
| 26 | |||
| 27 | $width = array( |
||
| 28 | 'on' => __( 'Yes', 'podlove-subscribe-button' ), |
||
| 29 | 'off' => __( 'No', 'podlove-subscribe-button' ), |
||
| 30 | ); |
||
| 31 | |||
| 32 | $size = array( |
||
| 33 | 'small' => __( 'Small', 'podlove-subscribe-button' ), |
||
| 34 | 'medium' => __( 'Medium', 'podlove-subscribe-button' ), |
||
| 35 | 'big' => __( 'Big', 'podlove-subscribe-button' ), |
||
| 36 | ); |
||
| 37 | |||
| 38 | $language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja', ); |
||
|
0 ignored issues
–
show
|
|||
| 39 | |||
| 40 | return $$property; |
||
| 41 | |||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
|
0 ignored issues
–
show
|
|||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | public static function media_types() { |
||
|
0 ignored issues
–
show
|
|||
| 48 | |||
| 49 | $media_types = array( |
||
| 50 | 0 => array( |
||
| 51 | 'title' => 'MP3 audio', |
||
| 52 | 'mime_type' => 'audio/mpeg', |
||
| 53 | 'extension' => 'mp3', |
||
| 54 | ), |
||
| 55 | 1 => array( |
||
| 56 | 'title' => 'MPEG-4 AAC Audio', |
||
| 57 | 'mime_type' => 'audio/mp4', |
||
| 58 | 'extension' => 'aac', |
||
| 59 | ), |
||
| 60 | 2 => array( |
||
| 61 | 'title' => 'MPEG-4 ALAC Audio', |
||
| 62 | 'mime_type' => 'audio/mp4', |
||
| 63 | 'extension' => 'aac', |
||
| 64 | ), |
||
| 65 | 3 => array( |
||
| 66 | 'title' => 'Ogg Vorbis Audio', |
||
| 67 | 'mime_type' => 'audio/ogg', |
||
| 68 | 'extension' => 'ogg', |
||
| 69 | ), |
||
| 70 | 4 => array( |
||
| 71 | 'title' => 'WebM Audio', |
||
| 72 | 'mime_type' => 'audio/webm', |
||
| 73 | 'extension' => 'webm', |
||
| 74 | ), |
||
| 75 | 5 => array( |
||
| 76 | 'title' => 'FLAC Audio', |
||
| 77 | 'mime_type' => 'audio/flac', |
||
| 78 | 'extension' => 'flac', |
||
| 79 | ), |
||
| 80 | 6 => array( |
||
| 81 | 'title' => 'Matroska Audio', |
||
| 82 | 'mime_type' => 'audio/x-matroska', |
||
| 83 | 'extension' => 'mka', |
||
| 84 | ), |
||
| 85 | 7 => array( |
||
| 86 | 'title' => 'Opus Audio', |
||
| 87 | 'mime_type' => 'audio/opus', |
||
| 88 | 'extension' => 'opus', |
||
| 89 | ) |
||
|
0 ignored issues
–
show
|
|||
| 90 | ); |
||
| 91 | |||
| 92 | return apply_filters( 'podlove_subscribe_button_defaults_media_types', $media_types ); |
||
| 93 | |||
| 94 | } |
||
| 95 | |||
| 96 | static function options() { |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
It is recommend to declare an explicit visibility for
options.
Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed. If you are not sure which visibility to choose, it is a good idea to start with
the most restrictive visibility, and then raise visibility as needed, i.e.
start with Loading history...
|
|||
| 97 | |||
| 98 | $options = array( |
||
| 99 | 'size' => 'big', |
||
| 100 | 'autowidth' => 'on', |
||
| 101 | 'color' => '#599677', |
||
| 102 | 'style' => 'filled', |
||
| 103 | 'format' => 'rectangle', |
||
| 104 | 'language' => \PodloveSubscribeButton\Helpers::language( '' ), |
||
| 105 | ); |
||
| 106 | |||
| 107 | return apply_filters( 'podlove_subscribe_button_defaults_options', $options ); |
||
| 108 | |||
| 109 | } |
||
| 110 | |||
| 111 | } // END class |
||
| 112 |