@@ -26,38 +26,38 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class Wordlift_i18n { |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * The domain specified for this plugin. |
|
| 31 | - * |
|
| 32 | - * @since 1.0.0 |
|
| 33 | - * @access private |
|
| 34 | - * @var string $domain The domain identifier for this plugin. |
|
| 35 | - */ |
|
| 36 | - private $domain; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Load the plugin text domain for translation. |
|
| 40 | - * |
|
| 41 | - * @since 1.0.0 |
|
| 42 | - */ |
|
| 43 | - public function load_plugin_textdomain() { |
|
| 44 | - |
|
| 45 | - load_plugin_textdomain( |
|
| 46 | - $this->domain, |
|
| 47 | - false, |
|
| 48 | - dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' |
|
| 49 | - ); |
|
| 50 | - |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Set the domain equal to that of the specified domain. |
|
| 55 | - * |
|
| 56 | - * @since 1.0.0 |
|
| 57 | - * @param string $domain The domain that represents the locale of this plugin. |
|
| 58 | - */ |
|
| 59 | - public function set_domain( $domain ) { |
|
| 60 | - $this->domain = $domain; |
|
| 61 | - } |
|
| 29 | + /** |
|
| 30 | + * The domain specified for this plugin. |
|
| 31 | + * |
|
| 32 | + * @since 1.0.0 |
|
| 33 | + * @access private |
|
| 34 | + * @var string $domain The domain identifier for this plugin. |
|
| 35 | + */ |
|
| 36 | + private $domain; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Load the plugin text domain for translation. |
|
| 40 | + * |
|
| 41 | + * @since 1.0.0 |
|
| 42 | + */ |
|
| 43 | + public function load_plugin_textdomain() { |
|
| 44 | + |
|
| 45 | + load_plugin_textdomain( |
|
| 46 | + $this->domain, |
|
| 47 | + false, |
|
| 48 | + dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' |
|
| 49 | + ); |
|
| 50 | + |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Set the domain equal to that of the specified domain. |
|
| 55 | + * |
|
| 56 | + * @since 1.0.0 |
|
| 57 | + * @param string $domain The domain that represents the locale of this plugin. |
|
| 58 | + */ |
|
| 59 | + public function set_domain( $domain ) { |
|
| 60 | + $this->domain = $domain; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | 63 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | load_plugin_textdomain( |
| 46 | 46 | $this->domain, |
| 47 | 47 | false, |
| 48 | - dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' |
|
| 48 | + dirname(dirname(plugin_basename(__FILE__))).'/languages/' |
|
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | 51 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @since 1.0.0 |
| 57 | 57 | * @param string $domain The domain that represents the locale of this plugin. |
| 58 | 58 | */ |
| 59 | - public function set_domain( $domain ) { |
|
| 59 | + public function set_domain($domain) { |
|
| 60 | 60 | $this->domain = $domain; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -23,107 +23,107 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | class Wordlift_Loader { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * The array of actions registered with WordPress. |
|
| 28 | - * |
|
| 29 | - * @since 1.0.0 |
|
| 30 | - * @access protected |
|
| 31 | - * @var array $actions The actions registered with WordPress to fire when the plugin loads. |
|
| 32 | - */ |
|
| 33 | - protected $actions; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * The array of filters registered with WordPress. |
|
| 37 | - * |
|
| 38 | - * @since 1.0.0 |
|
| 39 | - * @access protected |
|
| 40 | - * @var array $filters The filters registered with WordPress to fire when the plugin loads. |
|
| 41 | - */ |
|
| 42 | - protected $filters; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Initialize the collections used to maintain the actions and filters. |
|
| 46 | - * |
|
| 47 | - * @since 1.0.0 |
|
| 48 | - */ |
|
| 49 | - public function __construct() { |
|
| 50 | - |
|
| 51 | - $this->actions = array(); |
|
| 52 | - $this->filters = array(); |
|
| 53 | - |
|
| 54 | - } |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * Add a new action to the collection to be registered with WordPress. |
|
| 58 | - * |
|
| 59 | - * @since 1.0.0 |
|
| 60 | - * @param string $hook The name of the WordPress action that is being registered. |
|
| 61 | - * @param object $component A reference to the instance of the object on which the action is defined. |
|
| 62 | - * @param string $callback The name of the function definition on the $component. |
|
| 63 | - * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
|
| 64 | - * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
|
| 65 | - */ |
|
| 66 | - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 67 | - $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * Add a new filter to the collection to be registered with WordPress. |
|
| 72 | - * |
|
| 73 | - * @since 1.0.0 |
|
| 74 | - * @param string $hook The name of the WordPress filter that is being registered. |
|
| 75 | - * @param object $component A reference to the instance of the object on which the filter is defined. |
|
| 76 | - * @param string $callback The name of the function definition on the $component. |
|
| 77 | - * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
|
| 78 | - * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 |
|
| 79 | - */ |
|
| 80 | - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 81 | - $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * A utility function that is used to register the actions and hooks into a single |
|
| 86 | - * collection. |
|
| 87 | - * |
|
| 88 | - * @since 1.0.0 |
|
| 89 | - * @access private |
|
| 90 | - * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). |
|
| 91 | - * @param string $hook The name of the WordPress filter that is being registered. |
|
| 92 | - * @param object $component A reference to the instance of the object on which the filter is defined. |
|
| 93 | - * @param string $callback The name of the function definition on the $component. |
|
| 94 | - * @param int $priority The priority at which the function should be fired. |
|
| 95 | - * @param int $accepted_args The number of arguments that should be passed to the $callback. |
|
| 96 | - * @return array The collection of actions and filters registered with WordPress. |
|
| 97 | - */ |
|
| 98 | - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
| 99 | - |
|
| 100 | - $hooks[] = array( |
|
| 101 | - 'hook' => $hook, |
|
| 102 | - 'component' => $component, |
|
| 103 | - 'callback' => $callback, |
|
| 104 | - 'priority' => $priority, |
|
| 105 | - 'accepted_args' => $accepted_args |
|
| 106 | - ); |
|
| 107 | - |
|
| 108 | - return $hooks; |
|
| 109 | - |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Register the filters and actions with WordPress. |
|
| 114 | - * |
|
| 115 | - * @since 1.0.0 |
|
| 116 | - */ |
|
| 117 | - public function run() { |
|
| 118 | - |
|
| 119 | - foreach ( $this->filters as $hook ) { |
|
| 120 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - foreach ( $this->actions as $hook ) { |
|
| 124 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - } |
|
| 26 | + /** |
|
| 27 | + * The array of actions registered with WordPress. |
|
| 28 | + * |
|
| 29 | + * @since 1.0.0 |
|
| 30 | + * @access protected |
|
| 31 | + * @var array $actions The actions registered with WordPress to fire when the plugin loads. |
|
| 32 | + */ |
|
| 33 | + protected $actions; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * The array of filters registered with WordPress. |
|
| 37 | + * |
|
| 38 | + * @since 1.0.0 |
|
| 39 | + * @access protected |
|
| 40 | + * @var array $filters The filters registered with WordPress to fire when the plugin loads. |
|
| 41 | + */ |
|
| 42 | + protected $filters; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Initialize the collections used to maintain the actions and filters. |
|
| 46 | + * |
|
| 47 | + * @since 1.0.0 |
|
| 48 | + */ |
|
| 49 | + public function __construct() { |
|
| 50 | + |
|
| 51 | + $this->actions = array(); |
|
| 52 | + $this->filters = array(); |
|
| 53 | + |
|
| 54 | + } |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * Add a new action to the collection to be registered with WordPress. |
|
| 58 | + * |
|
| 59 | + * @since 1.0.0 |
|
| 60 | + * @param string $hook The name of the WordPress action that is being registered. |
|
| 61 | + * @param object $component A reference to the instance of the object on which the action is defined. |
|
| 62 | + * @param string $callback The name of the function definition on the $component. |
|
| 63 | + * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
|
| 64 | + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
|
| 65 | + */ |
|
| 66 | + public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 67 | + $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * Add a new filter to the collection to be registered with WordPress. |
|
| 72 | + * |
|
| 73 | + * @since 1.0.0 |
|
| 74 | + * @param string $hook The name of the WordPress filter that is being registered. |
|
| 75 | + * @param object $component A reference to the instance of the object on which the filter is defined. |
|
| 76 | + * @param string $callback The name of the function definition on the $component. |
|
| 77 | + * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
|
| 78 | + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 |
|
| 79 | + */ |
|
| 80 | + public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 81 | + $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * A utility function that is used to register the actions and hooks into a single |
|
| 86 | + * collection. |
|
| 87 | + * |
|
| 88 | + * @since 1.0.0 |
|
| 89 | + * @access private |
|
| 90 | + * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). |
|
| 91 | + * @param string $hook The name of the WordPress filter that is being registered. |
|
| 92 | + * @param object $component A reference to the instance of the object on which the filter is defined. |
|
| 93 | + * @param string $callback The name of the function definition on the $component. |
|
| 94 | + * @param int $priority The priority at which the function should be fired. |
|
| 95 | + * @param int $accepted_args The number of arguments that should be passed to the $callback. |
|
| 96 | + * @return array The collection of actions and filters registered with WordPress. |
|
| 97 | + */ |
|
| 98 | + private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
| 99 | + |
|
| 100 | + $hooks[] = array( |
|
| 101 | + 'hook' => $hook, |
|
| 102 | + 'component' => $component, |
|
| 103 | + 'callback' => $callback, |
|
| 104 | + 'priority' => $priority, |
|
| 105 | + 'accepted_args' => $accepted_args |
|
| 106 | + ); |
|
| 107 | + |
|
| 108 | + return $hooks; |
|
| 109 | + |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Register the filters and actions with WordPress. |
|
| 114 | + * |
|
| 115 | + * @since 1.0.0 |
|
| 116 | + */ |
|
| 117 | + public function run() { |
|
| 118 | + |
|
| 119 | + foreach ( $this->filters as $hook ) { |
|
| 120 | + add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + foreach ( $this->actions as $hook ) { |
|
| 124 | + add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | 129 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
| 64 | 64 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. |
| 65 | 65 | */ |
| 66 | - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 67 | - $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 66 | + public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
| 67 | + $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | * @param int $priority Optional. he priority at which the function should be fired. Default is 10. |
| 78 | 78 | * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 |
| 79 | 79 | */ |
| 80 | - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { |
|
| 81 | - $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); |
|
| 80 | + public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) { |
|
| 81 | + $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param int $accepted_args The number of arguments that should be passed to the $callback. |
| 96 | 96 | * @return array The collection of actions and filters registered with WordPress. |
| 97 | 97 | */ |
| 98 | - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
|
| 98 | + private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) { |
|
| 99 | 99 | |
| 100 | 100 | $hooks[] = array( |
| 101 | 101 | 'hook' => $hook, |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function run() { |
| 118 | 118 | |
| 119 | - foreach ( $this->filters as $hook ) { |
|
| 120 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 119 | + foreach ($this->filters as $hook) { |
|
| 120 | + add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - foreach ( $this->actions as $hook ) { |
|
| 124 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
| 123 | + foreach ($this->actions as $hook) { |
|
| 124 | + add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | } |
@@ -9,28 +9,28 @@ discard block |
||
| 9 | 9 | * @param array $atts An array of shortcode attributes. |
| 10 | 10 | * @return string A dom element with requested property value(s). |
| 11 | 11 | */ |
| 12 | -function wl_shortcode_field( $atts ) { |
|
| 12 | +function wl_shortcode_field($atts) { |
|
| 13 | 13 | |
| 14 | 14 | // Extract attributes and set default values. |
| 15 | - $field_atts = shortcode_atts( array( |
|
| 15 | + $field_atts = shortcode_atts(array( |
|
| 16 | 16 | 'id' => null, |
| 17 | 17 | 'name' => null |
| 18 | - ), $atts ); |
|
| 18 | + ), $atts); |
|
| 19 | 19 | |
| 20 | 20 | // Get id of the post |
| 21 | 21 | $entity_id = $field_atts['id']; |
| 22 | - if( is_null( $field_atts['id'] ) || !is_numeric( $field_atts['id'] ) ) { |
|
| 22 | + if (is_null($field_atts['id']) || ! is_numeric($field_atts['id'])) { |
|
| 23 | 23 | $entity_id = get_the_ID(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $property_name = $field_atts['name']; |
| 27 | - if( !is_null( $property_name ) ) { |
|
| 28 | - $values = wl_schema_get_value( $entity_id, $property_name ); |
|
| 27 | + if ( ! is_null($property_name)) { |
|
| 28 | + $values = wl_schema_get_value($entity_id, $property_name); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // Return |
| 32 | - if( is_array( $values ) ) { |
|
| 33 | - return implode( ', ', $values ); |
|
| 32 | + if (is_array($values)) { |
|
| 33 | + return implode(', ', $values); |
|
| 34 | 34 | } else { |
| 35 | 35 | return null; |
| 36 | 36 | } |
@@ -40,5 +40,5 @@ discard block |
||
| 40 | 40 | add_shortcode('wl_field', 'wl_shortcode_field'); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -add_action( 'init', 'wl_register_shortcode_field'); |
|
| 43 | +add_action('init', 'wl_register_shortcode_field'); |
|
| 44 | 44 | |
@@ -7,80 +7,80 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class Wordlift_UI_Service { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * The button element HTML code. |
|
| 12 | - * |
|
| 13 | - * @since 3.2.0 |
|
| 14 | - */ |
|
| 15 | - const BUTTON_HTML = '<a id="%s" class="button wl-button">%s</a>'; |
|
| 10 | + /** |
|
| 11 | + * The button element HTML code. |
|
| 12 | + * |
|
| 13 | + * @since 3.2.0 |
|
| 14 | + */ |
|
| 15 | + const BUTTON_HTML = '<a id="%s" class="button wl-button">%s</a>'; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * The template HTML code. |
|
| 19 | - * |
|
| 20 | - * @since 3.2.0 |
|
| 21 | - */ |
|
| 22 | - const TEMPLATE_HTML = '<script id="%s" type="text/template">%s</script>'; |
|
| 17 | + /** |
|
| 18 | + * The template HTML code. |
|
| 19 | + * |
|
| 20 | + * @since 3.2.0 |
|
| 21 | + */ |
|
| 22 | + const TEMPLATE_HTML = '<script id="%s" type="text/template">%s</script>'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Get the button HTML. |
|
| 26 | - * |
|
| 27 | - * @since 3.2.0 |
|
| 28 | - * |
|
| 29 | - * @param string $element_id The button element id. |
|
| 30 | - * @param string $label The button (translated) label. |
|
| 31 | - * |
|
| 32 | - * @return string The button HTML code. |
|
| 33 | - */ |
|
| 34 | - public function get_button_html( $element_id, $label ) { |
|
| 24 | + /** |
|
| 25 | + * Get the button HTML. |
|
| 26 | + * |
|
| 27 | + * @since 3.2.0 |
|
| 28 | + * |
|
| 29 | + * @param string $element_id The button element id. |
|
| 30 | + * @param string $label The button (translated) label. |
|
| 31 | + * |
|
| 32 | + * @return string The button HTML code. |
|
| 33 | + */ |
|
| 34 | + public function get_button_html( $element_id, $label ) { |
|
| 35 | 35 | |
| 36 | - return sprintf( self::BUTTON_HTML, $element_id, esc_html( $label ) ); |
|
| 37 | - } |
|
| 36 | + return sprintf( self::BUTTON_HTML, $element_id, esc_html( $label ) ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Echo the button HTML. |
|
| 41 | - * |
|
| 42 | - * @since 3.2.0 |
|
| 43 | - * |
|
| 44 | - * @param string $element_id The button element id. |
|
| 45 | - * @param string $label The button (translated) label. |
|
| 46 | - * |
|
| 47 | - * @return string The button HTML code. |
|
| 48 | - */ |
|
| 49 | - public function print_button( $element_id, $label ) { |
|
| 39 | + /** |
|
| 40 | + * Echo the button HTML. |
|
| 41 | + * |
|
| 42 | + * @since 3.2.0 |
|
| 43 | + * |
|
| 44 | + * @param string $element_id The button element id. |
|
| 45 | + * @param string $label The button (translated) label. |
|
| 46 | + * |
|
| 47 | + * @return string The button HTML code. |
|
| 48 | + */ |
|
| 49 | + public function print_button( $element_id, $label ) { |
|
| 50 | 50 | |
| 51 | - echo( $this->get_button_html( $element_id, $label ) ); |
|
| 51 | + echo( $this->get_button_html( $element_id, $label ) ); |
|
| 52 | 52 | |
| 53 | - } |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Get the HTML code for a template tag. |
|
| 57 | - * |
|
| 58 | - * @since 3.2.0 |
|
| 59 | - * |
|
| 60 | - * @param string $element_id The element id. |
|
| 61 | - * @param string $body The element content. |
|
| 62 | - * |
|
| 63 | - * @return string The HTML code. |
|
| 64 | - */ |
|
| 65 | - public function get_template_html( $element_id, $body ) { |
|
| 55 | + /** |
|
| 56 | + * Get the HTML code for a template tag. |
|
| 57 | + * |
|
| 58 | + * @since 3.2.0 |
|
| 59 | + * |
|
| 60 | + * @param string $element_id The element id. |
|
| 61 | + * @param string $body The element content. |
|
| 62 | + * |
|
| 63 | + * @return string The HTML code. |
|
| 64 | + */ |
|
| 65 | + public function get_template_html( $element_id, $body ) { |
|
| 66 | 66 | |
| 67 | - return sprintf( self::TEMPLATE_HTML, $element_id, $body ); |
|
| 68 | - } |
|
| 67 | + return sprintf( self::TEMPLATE_HTML, $element_id, $body ); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * Echo the HTML code for a template tag. |
|
| 72 | - * |
|
| 73 | - * @since 3.2.0 |
|
| 74 | - * |
|
| 75 | - * @param string $element_id The element id. |
|
| 76 | - * @param string $body The element content. |
|
| 77 | - * |
|
| 78 | - * @return string The HTML code. |
|
| 79 | - */ |
|
| 80 | - public function print_template( $element_id, $body ) { |
|
| 70 | + /** |
|
| 71 | + * Echo the HTML code for a template tag. |
|
| 72 | + * |
|
| 73 | + * @since 3.2.0 |
|
| 74 | + * |
|
| 75 | + * @param string $element_id The element id. |
|
| 76 | + * @param string $body The element content. |
|
| 77 | + * |
|
| 78 | + * @return string The HTML code. |
|
| 79 | + */ |
|
| 80 | + public function print_template( $element_id, $body ) { |
|
| 81 | 81 | |
| 82 | - echo( $this->get_template_html( $element_id, $body ) ); |
|
| 82 | + echo( $this->get_template_html( $element_id, $body ) ); |
|
| 83 | 83 | |
| 84 | - } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | 86 | } |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return string The button HTML code. |
| 33 | 33 | */ |
| 34 | - public function get_button_html( $element_id, $label ) { |
|
| 34 | + public function get_button_html($element_id, $label) { |
|
| 35 | 35 | |
| 36 | - return sprintf( self::BUTTON_HTML, $element_id, esc_html( $label ) ); |
|
| 36 | + return sprintf(self::BUTTON_HTML, $element_id, esc_html($label)); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return string The button HTML code. |
| 48 | 48 | */ |
| 49 | - public function print_button( $element_id, $label ) { |
|
| 49 | + public function print_button($element_id, $label) { |
|
| 50 | 50 | |
| 51 | - echo( $this->get_button_html( $element_id, $label ) ); |
|
| 51 | + echo($this->get_button_html($element_id, $label)); |
|
| 52 | 52 | |
| 53 | 53 | } |
| 54 | 54 | |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @return string The HTML code. |
| 64 | 64 | */ |
| 65 | - public function get_template_html( $element_id, $body ) { |
|
| 65 | + public function get_template_html($element_id, $body) { |
|
| 66 | 66 | |
| 67 | - return sprintf( self::TEMPLATE_HTML, $element_id, $body ); |
|
| 67 | + return sprintf(self::TEMPLATE_HTML, $element_id, $body); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return string The HTML code. |
| 79 | 79 | */ |
| 80 | - public function print_template( $element_id, $body ) { |
|
| 80 | + public function print_template($element_id, $body) { |
|
| 81 | 81 | |
| 82 | - echo( $this->get_template_html( $element_id, $body ) ); |
|
| 82 | + echo($this->get_template_html($element_id, $body)); |
|
| 83 | 83 | |
| 84 | 84 | } |
| 85 | 85 | |
@@ -7,33 +7,33 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class Wordlift_PrimaShop_Adapter { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * Create a Wordlift_PrimaShop_Adapter instance. |
|
| 12 | - * |
|
| 13 | - * @since 3.2.3 |
|
| 14 | - */ |
|
| 15 | - public function __construct() { |
|
| 10 | + /** |
|
| 11 | + * Create a Wordlift_PrimaShop_Adapter instance. |
|
| 12 | + * |
|
| 13 | + * @since 3.2.3 |
|
| 14 | + */ |
|
| 15 | + public function __construct() { |
|
| 16 | 16 | |
| 17 | - // Tell WP (and PrimaShop) that we support the *prima-layout-settings*. This will display the Content Settings |
|
| 18 | - // in the entity edit page. |
|
| 19 | - add_post_type_support( Wordlift_Entity_Service::TYPE_NAME, 'prima-layout-settings' ); |
|
| 17 | + // Tell WP (and PrimaShop) that we support the *prima-layout-settings*. This will display the Content Settings |
|
| 18 | + // in the entity edit page. |
|
| 19 | + add_post_type_support( Wordlift_Entity_Service::TYPE_NAME, 'prima-layout-settings' ); |
|
| 20 | 20 | |
| 21 | - } |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Intercept the <em>prima_metabox_entity_header_args</em> filter and return what a call to the related <em>post</em> |
|
| 25 | - * would have returned. |
|
| 26 | - * |
|
| 27 | - * @since 3.2.3 |
|
| 28 | - * |
|
| 29 | - * @param array $meta The meta array. |
|
| 30 | - * @param string $ype The post type. |
|
| 31 | - * |
|
| 32 | - * @return array A meta array. |
|
| 33 | - */ |
|
| 34 | - function prima_metabox_entity_header_args( $meta, $ype ) { |
|
| 23 | + /** |
|
| 24 | + * Intercept the <em>prima_metabox_entity_header_args</em> filter and return what a call to the related <em>post</em> |
|
| 25 | + * would have returned. |
|
| 26 | + * |
|
| 27 | + * @since 3.2.3 |
|
| 28 | + * |
|
| 29 | + * @param array $meta The meta array. |
|
| 30 | + * @param string $ype The post type. |
|
| 31 | + * |
|
| 32 | + * @return array A meta array. |
|
| 33 | + */ |
|
| 34 | + function prima_metabox_entity_header_args( $meta, $ype ) { |
|
| 35 | 35 | |
| 36 | - return apply_filters( "prima_metabox_post_header_args", $meta, 'post' ); |
|
| 37 | - } |
|
| 36 | + return apply_filters( "prima_metabox_post_header_args", $meta, 'post' ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // Tell WP (and PrimaShop) that we support the *prima-layout-settings*. This will display the Content Settings |
| 18 | 18 | // in the entity edit page. |
| 19 | - add_post_type_support( Wordlift_Entity_Service::TYPE_NAME, 'prima-layout-settings' ); |
|
| 19 | + add_post_type_support(Wordlift_Entity_Service::TYPE_NAME, 'prima-layout-settings'); |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return array A meta array. |
| 33 | 33 | */ |
| 34 | - function prima_metabox_entity_header_args( $meta, $ype ) { |
|
| 34 | + function prima_metabox_entity_header_args($meta, $ype) { |
|
| 35 | 35 | |
| 36 | - return apply_filters( "prima_metabox_post_header_args", $meta, 'post' ); |
|
| 36 | + return apply_filters("prima_metabox_post_header_args", $meta, 'post'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | } |
@@ -3,11 +3,11 @@ |
||
| 3 | 3 | // File created to manage some dynamic translation used in the code |
| 4 | 4 | // See http://keithdevon.com/using-variables-wordpress-translation-functions/ |
| 5 | 5 | |
| 6 | -__( 'There are no related posts for the current entity.', 'wordlift' ); |
|
| 7 | -__( 'This entity has not description.', 'wordlift' ); |
|
| 8 | -__( 'There are no related entities for the current entity.', 'wordlift' ); |
|
| 9 | -__( 'This entity is not published. It will not appear within analysis results.', 'wordlift' ); |
|
| 10 | -__( 'This entity has no featured image yet.', 'wordlift' ); |
|
| 11 | -__( 'There are no sameAs configured for this entity.', 'wordlift' ); |
|
| 12 | -__( 'Schema.org metadata for this entity are not completed.', 'wordlift' ); |
|
| 6 | +__('There are no related posts for the current entity.', 'wordlift'); |
|
| 7 | +__('This entity has not description.', 'wordlift'); |
|
| 8 | +__('There are no related entities for the current entity.', 'wordlift'); |
|
| 9 | +__('This entity is not published. It will not appear within analysis results.', 'wordlift'); |
|
| 10 | +__('This entity has no featured image yet.', 'wordlift'); |
|
| 11 | +__('There are no sameAs configured for this entity.', 'wordlift'); |
|
| 12 | +__('Schema.org metadata for this entity are not completed.', 'wordlift'); |
|
| 13 | 13 | |
@@ -8,50 +8,50 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | abstract class Wordlift_Shortcode { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * The shortcode, set by extending classes. |
|
| 13 | - */ |
|
| 14 | - const SHORTCODE = NULL; |
|
| 15 | - |
|
| 16 | - /** |
|
| 17 | - * Create a shortcode instance by registering the shortcode with the render |
|
| 18 | - * function. |
|
| 19 | - * |
|
| 20 | - * @since 3.5.4 |
|
| 21 | - */ |
|
| 22 | - public function __construct() { |
|
| 23 | - |
|
| 24 | - add_shortcode( static::SHORTCODE, array( $this, 'render' ) ); |
|
| 25 | - |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Render the shortcode. |
|
| 30 | - * |
|
| 31 | - * @since 3.5.4 |
|
| 32 | - * |
|
| 33 | - * @param array $atts An array of shortcode attributes as set by the editor. |
|
| 34 | - * |
|
| 35 | - * @return string The output html code. |
|
| 36 | - */ |
|
| 37 | - public abstract function render( $atts ); |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Enqueue scripts. Called by the shortcode implementations in their render |
|
| 41 | - * method. |
|
| 42 | - * |
|
| 43 | - * @since 3.5.4 |
|
| 44 | - */ |
|
| 45 | - protected function enqueue_scripts() { |
|
| 46 | - |
|
| 47 | - wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' ); |
|
| 48 | - wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js', array( 'angularjs' ) ); |
|
| 49 | - wp_enqueue_script( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.js', array( |
|
| 50 | - 'jquery', |
|
| 51 | - 'angularjs', |
|
| 52 | - 'angularjs-touch' |
|
| 53 | - ) ); |
|
| 54 | - |
|
| 55 | - } |
|
| 11 | + /** |
|
| 12 | + * The shortcode, set by extending classes. |
|
| 13 | + */ |
|
| 14 | + const SHORTCODE = NULL; |
|
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * Create a shortcode instance by registering the shortcode with the render |
|
| 18 | + * function. |
|
| 19 | + * |
|
| 20 | + * @since 3.5.4 |
|
| 21 | + */ |
|
| 22 | + public function __construct() { |
|
| 23 | + |
|
| 24 | + add_shortcode( static::SHORTCODE, array( $this, 'render' ) ); |
|
| 25 | + |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Render the shortcode. |
|
| 30 | + * |
|
| 31 | + * @since 3.5.4 |
|
| 32 | + * |
|
| 33 | + * @param array $atts An array of shortcode attributes as set by the editor. |
|
| 34 | + * |
|
| 35 | + * @return string The output html code. |
|
| 36 | + */ |
|
| 37 | + public abstract function render( $atts ); |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Enqueue scripts. Called by the shortcode implementations in their render |
|
| 41 | + * method. |
|
| 42 | + * |
|
| 43 | + * @since 3.5.4 |
|
| 44 | + */ |
|
| 45 | + protected function enqueue_scripts() { |
|
| 46 | + |
|
| 47 | + wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' ); |
|
| 48 | + wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js', array( 'angularjs' ) ); |
|
| 49 | + wp_enqueue_script( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.js', array( |
|
| 50 | + 'jquery', |
|
| 51 | + 'angularjs', |
|
| 52 | + 'angularjs-touch' |
|
| 53 | + ) ); |
|
| 54 | + |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct() { |
| 23 | 23 | |
| 24 | - add_shortcode( static::SHORTCODE, array( $this, 'render' ) ); |
|
| 24 | + add_shortcode(static::SHORTCODE, array($this, 'render')); |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @return string The output html code. |
| 36 | 36 | */ |
| 37 | - public abstract function render( $atts ); |
|
| 37 | + public abstract function render($atts); |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Enqueue scripts. Called by the shortcode implementations in their render |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function enqueue_scripts() { |
| 46 | 46 | |
| 47 | - wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' ); |
|
| 48 | - wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js', array( 'angularjs' ) ); |
|
| 49 | - wp_enqueue_script( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.js', array( |
|
| 47 | + wp_enqueue_script('angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js'); |
|
| 48 | + wp_enqueue_script('angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js', array('angularjs')); |
|
| 49 | + wp_enqueue_script('wordlift-ui', dirname(plugin_dir_url(__FILE__)).'/js/wordlift-ui'.( ! defined('SCRIPT_DEBUG') || ! SCRIPT_DEBUG ? '.min' : '').'.js', array( |
|
| 50 | 50 | 'jquery', |
| 51 | 51 | 'angularjs', |
| 52 | 52 | 'angularjs-touch' |
| 53 | - ) ); |
|
| 53 | + )); |
|
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | |
@@ -11,56 +11,56 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Wordlift_Property_Factory { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * The default {@link Wordlift_Property_Service}. |
|
| 16 | - * |
|
| 17 | - * @since 3.7.0 |
|
| 18 | - * @access private |
|
| 19 | - * @var \Wordlift_Property_Service $default_property_service The default {@link Wordlift_Property_Service}. |
|
| 20 | - */ |
|
| 21 | - private $default_property_service; |
|
| 14 | + /** |
|
| 15 | + * The default {@link Wordlift_Property_Service}. |
|
| 16 | + * |
|
| 17 | + * @since 3.7.0 |
|
| 18 | + * @access private |
|
| 19 | + * @var \Wordlift_Property_Service $default_property_service The default {@link Wordlift_Property_Service}. |
|
| 20 | + */ |
|
| 21 | + private $default_property_service; |
|
| 22 | 22 | |
| 23 | - private $property_services = array(); |
|
| 23 | + private $property_services = array(); |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Wordlift_Property_Factory constructor. |
|
| 27 | - * |
|
| 28 | - * @since 3.7.0 |
|
| 29 | - * |
|
| 30 | - * @param \Wordlift_Property_Service $default_property_service |
|
| 31 | - */ |
|
| 32 | - public function __construct( $default_property_service ) { |
|
| 25 | + /** |
|
| 26 | + * Wordlift_Property_Factory constructor. |
|
| 27 | + * |
|
| 28 | + * @since 3.7.0 |
|
| 29 | + * |
|
| 30 | + * @param \Wordlift_Property_Service $default_property_service |
|
| 31 | + */ |
|
| 32 | + public function __construct( $default_property_service ) { |
|
| 33 | 33 | |
| 34 | - $this->default_property_service = $default_property_service; |
|
| 34 | + $this->default_property_service = $default_property_service; |
|
| 35 | 35 | |
| 36 | - } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Set the {@link Wordlift_Property_Service} which handles that meta key. |
|
| 40 | - * |
|
| 41 | - * @since 3.7.0 |
|
| 42 | - * |
|
| 43 | - * @param string $meta_key WordPress' meta key. |
|
| 44 | - * @param \Wordlift_Property_Service $property_service A {@link Wordlift_Property_Service} instance. |
|
| 45 | - */ |
|
| 46 | - public function register( $meta_key, $property_service ) { |
|
| 38 | + /** |
|
| 39 | + * Set the {@link Wordlift_Property_Service} which handles that meta key. |
|
| 40 | + * |
|
| 41 | + * @since 3.7.0 |
|
| 42 | + * |
|
| 43 | + * @param string $meta_key WordPress' meta key. |
|
| 44 | + * @param \Wordlift_Property_Service $property_service A {@link Wordlift_Property_Service} instance. |
|
| 45 | + */ |
|
| 46 | + public function register( $meta_key, $property_service ) { |
|
| 47 | 47 | |
| 48 | - $this->property_services[ $meta_key ] = $property_service; |
|
| 48 | + $this->property_services[ $meta_key ] = $property_service; |
|
| 49 | 49 | |
| 50 | - } |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Get the {@link Wordlift_Property_Service} which handles the specified meta key. |
|
| 54 | - * |
|
| 55 | - * @since 3.7.0 |
|
| 56 | - * |
|
| 57 | - * @param $meta_key |
|
| 58 | - * |
|
| 59 | - * @return \Wordlift_Property_Service The {@link Wordlift_Property_Service} which handles the specified meta key. |
|
| 60 | - */ |
|
| 61 | - public function get( $meta_key ) { |
|
| 52 | + /** |
|
| 53 | + * Get the {@link Wordlift_Property_Service} which handles the specified meta key. |
|
| 54 | + * |
|
| 55 | + * @since 3.7.0 |
|
| 56 | + * |
|
| 57 | + * @param $meta_key |
|
| 58 | + * |
|
| 59 | + * @return \Wordlift_Property_Service The {@link Wordlift_Property_Service} which handles the specified meta key. |
|
| 60 | + */ |
|
| 61 | + public function get( $meta_key ) { |
|
| 62 | 62 | |
| 63 | - return $this->property_services[ $meta_key ] ?: $this->default_property_service; |
|
| 64 | - } |
|
| 63 | + return $this->property_services[ $meta_key ] ?: $this->default_property_service; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param \Wordlift_Property_Service $default_property_service |
| 31 | 31 | */ |
| 32 | - public function __construct( $default_property_service ) { |
|
| 32 | + public function __construct($default_property_service) { |
|
| 33 | 33 | |
| 34 | 34 | $this->default_property_service = $default_property_service; |
| 35 | 35 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * @param string $meta_key WordPress' meta key. |
| 44 | 44 | * @param \Wordlift_Property_Service $property_service A {@link Wordlift_Property_Service} instance. |
| 45 | 45 | */ |
| 46 | - public function register( $meta_key, $property_service ) { |
|
| 46 | + public function register($meta_key, $property_service) { |
|
| 47 | 47 | |
| 48 | - $this->property_services[ $meta_key ] = $property_service; |
|
| 48 | + $this->property_services[$meta_key] = $property_service; |
|
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @return \Wordlift_Property_Service The {@link Wordlift_Property_Service} which handles the specified meta key. |
| 60 | 60 | */ |
| 61 | - public function get( $meta_key ) { |
|
| 61 | + public function get($meta_key) { |
|
| 62 | 62 | |
| 63 | - return $this->property_services[ $meta_key ] ?: $this->default_property_service; |
|
| 63 | + return $this->property_services[$meta_key] ?: $this->default_property_service; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 3.9.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -82,15 +82,15 @@ discard block |
||
| 82 | 82 | public static function get_languages() { |
| 83 | 83 | |
| 84 | 84 | // Lazily load the languages. |
| 85 | - if ( null === self::$languages ) { |
|
| 85 | + if (null === self::$languages) { |
|
| 86 | 86 | |
| 87 | 87 | // Get the language names from WP's own (multisite) function. |
| 88 | - foreach ( self::$codes as $key ) { |
|
| 89 | - self::$languages[ $key ] = self::format_code_lang( $key ); |
|
| 88 | + foreach (self::$codes as $key) { |
|
| 89 | + self::$languages[$key] = self::format_code_lang($key); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Sort by language name. |
| 93 | - asort( self::$languages ); |
|
| 93 | + asort(self::$languages); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return self::$languages; |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | * @return string The language corresponding to $code if it exists. If it does not exist, |
| 107 | 107 | * then the first two letters of $code is returned. |
| 108 | 108 | */ |
| 109 | - private static function format_code_lang( $code = '' ) { |
|
| 110 | - $code = strtolower( substr( $code, 0, 2 ) ); |
|
| 109 | + private static function format_code_lang($code = '') { |
|
| 110 | + $code = strtolower(substr($code, 0, 2)); |
|
| 111 | 111 | $lang_codes = array( |
| 112 | 112 | 'aa' => 'Afar', |
| 113 | 113 | 'ab' => 'Abkhazian', |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | * @param array $lang_codes Key/value pair of language codes where key is the short version. |
| 305 | 305 | * @param string $code A two-letter designation of the language. |
| 306 | 306 | */ |
| 307 | - $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); |
|
| 307 | + $lang_codes = apply_filters('lang_codes', $lang_codes, $code); |
|
| 308 | 308 | |
| 309 | - return strtr( $code, $lang_codes ); |
|
| 309 | + return strtr($code, $lang_codes); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -21,295 +21,295 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class Wordlift_Languages { |
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * An array that will contain language codes => language names pairs. It gets lazily loaded the first time by the |
|
| 26 | - * `get_languages` function. |
|
| 27 | - * |
|
| 28 | - * @since 3.9.0 |
|
| 29 | - * @var array|null An array of language codes => language names pairs or NULL if not initialized yet. |
|
| 30 | - */ |
|
| 31 | - private static $languages = null; |
|
| 24 | + /** |
|
| 25 | + * An array that will contain language codes => language names pairs. It gets lazily loaded the first time by the |
|
| 26 | + * `get_languages` function. |
|
| 27 | + * |
|
| 28 | + * @since 3.9.0 |
|
| 29 | + * @var array|null An array of language codes => language names pairs or NULL if not initialized yet. |
|
| 30 | + */ |
|
| 31 | + private static $languages = null; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * The list of supported language codes. |
|
| 35 | - * |
|
| 36 | - * @since 3.9.0 |
|
| 37 | - * |
|
| 38 | - * @var array An array of language codes. |
|
| 39 | - */ |
|
| 40 | - private static $codes = array( |
|
| 41 | - 'ar', |
|
| 42 | - 'be', |
|
| 43 | - 'bg', |
|
| 44 | - 'ca', |
|
| 45 | - 'cs', |
|
| 46 | - 'da', |
|
| 47 | - 'de', |
|
| 48 | - 'el', |
|
| 49 | - 'en', |
|
| 50 | - 'es', |
|
| 51 | - 'et', |
|
| 52 | - 'fi', |
|
| 53 | - 'fr', |
|
| 54 | - 'he', |
|
| 55 | - 'hr', |
|
| 56 | - 'hu', |
|
| 57 | - 'id', |
|
| 58 | - 'is', |
|
| 59 | - 'it', |
|
| 60 | - 'lt', |
|
| 61 | - 'lv', |
|
| 62 | - 'nl', |
|
| 63 | - 'no', |
|
| 64 | - 'pl', |
|
| 65 | - 'pt', |
|
| 66 | - 'ro', |
|
| 67 | - 'ru', |
|
| 68 | - 'sk', |
|
| 69 | - 'sl', |
|
| 70 | - 'sq', |
|
| 71 | - 'sr', |
|
| 72 | - 'sv', |
|
| 73 | - 'tr', |
|
| 74 | - 'uk', |
|
| 75 | - 'zh-cn', |
|
| 76 | - ); |
|
| 33 | + /** |
|
| 34 | + * The list of supported language codes. |
|
| 35 | + * |
|
| 36 | + * @since 3.9.0 |
|
| 37 | + * |
|
| 38 | + * @var array An array of language codes. |
|
| 39 | + */ |
|
| 40 | + private static $codes = array( |
|
| 41 | + 'ar', |
|
| 42 | + 'be', |
|
| 43 | + 'bg', |
|
| 44 | + 'ca', |
|
| 45 | + 'cs', |
|
| 46 | + 'da', |
|
| 47 | + 'de', |
|
| 48 | + 'el', |
|
| 49 | + 'en', |
|
| 50 | + 'es', |
|
| 51 | + 'et', |
|
| 52 | + 'fi', |
|
| 53 | + 'fr', |
|
| 54 | + 'he', |
|
| 55 | + 'hr', |
|
| 56 | + 'hu', |
|
| 57 | + 'id', |
|
| 58 | + 'is', |
|
| 59 | + 'it', |
|
| 60 | + 'lt', |
|
| 61 | + 'lv', |
|
| 62 | + 'nl', |
|
| 63 | + 'no', |
|
| 64 | + 'pl', |
|
| 65 | + 'pt', |
|
| 66 | + 'ro', |
|
| 67 | + 'ru', |
|
| 68 | + 'sk', |
|
| 69 | + 'sl', |
|
| 70 | + 'sq', |
|
| 71 | + 'sr', |
|
| 72 | + 'sv', |
|
| 73 | + 'tr', |
|
| 74 | + 'uk', |
|
| 75 | + 'zh-cn', |
|
| 76 | + ); |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * Get the list of WordLift's supported languages in an array with language code => language name pairs. |
|
| 80 | - * |
|
| 81 | - * @since 3.9.0 |
|
| 82 | - * |
|
| 83 | - * @return array An array with language code => language name pairs. |
|
| 84 | - */ |
|
| 85 | - public static function get_languages() { |
|
| 78 | + /** |
|
| 79 | + * Get the list of WordLift's supported languages in an array with language code => language name pairs. |
|
| 80 | + * |
|
| 81 | + * @since 3.9.0 |
|
| 82 | + * |
|
| 83 | + * @return array An array with language code => language name pairs. |
|
| 84 | + */ |
|
| 85 | + public static function get_languages() { |
|
| 86 | 86 | |
| 87 | - // Lazily load the languages. |
|
| 88 | - if ( null === self::$languages ) { |
|
| 87 | + // Lazily load the languages. |
|
| 88 | + if ( null === self::$languages ) { |
|
| 89 | 89 | |
| 90 | - // Get the language names from WP's own (multisite) function. |
|
| 91 | - foreach ( self::$codes as $key ) { |
|
| 92 | - self::$languages[ $key ] = self::format_code_lang( $key ); |
|
| 93 | - } |
|
| 90 | + // Get the language names from WP's own (multisite) function. |
|
| 91 | + foreach ( self::$codes as $key ) { |
|
| 92 | + self::$languages[ $key ] = self::format_code_lang( $key ); |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - // Sort by language name. |
|
| 96 | - asort( self::$languages ); |
|
| 97 | - } |
|
| 95 | + // Sort by language name. |
|
| 96 | + asort( self::$languages ); |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - return self::$languages; |
|
| 100 | - } |
|
| 99 | + return self::$languages; |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - /** |
|
| 103 | - * Returns the language for a language code. This function is a clone of WP's function provided in `ms.php`. |
|
| 104 | - * |
|
| 105 | - * @since 3.9.3 |
|
| 106 | - * |
|
| 107 | - * @param string $code Optional. The two-letter language code. Default empty. |
|
| 108 | - * |
|
| 109 | - * @return string The language corresponding to $code if it exists. If it does not exist, |
|
| 110 | - * then the first two letters of $code is returned. |
|
| 111 | - */ |
|
| 112 | - private static function format_code_lang( $code = '' ) { |
|
| 113 | - $code = strtolower( substr( $code, 0, 2 ) ); |
|
| 114 | - $lang_codes = array( |
|
| 115 | - 'aa' => 'Afar', |
|
| 116 | - 'ab' => 'Abkhazian', |
|
| 117 | - 'af' => 'Afrikaans', |
|
| 118 | - 'ak' => 'Akan', |
|
| 119 | - 'sq' => 'Albanian', |
|
| 120 | - 'am' => 'Amharic', |
|
| 121 | - 'ar' => 'Arabic', |
|
| 122 | - 'an' => 'Aragonese', |
|
| 123 | - 'hy' => 'Armenian', |
|
| 124 | - 'as' => 'Assamese', |
|
| 125 | - 'av' => 'Avaric', |
|
| 126 | - 'ae' => 'Avestan', |
|
| 127 | - 'ay' => 'Aymara', |
|
| 128 | - 'az' => 'Azerbaijani', |
|
| 129 | - 'ba' => 'Bashkir', |
|
| 130 | - 'bm' => 'Bambara', |
|
| 131 | - 'eu' => 'Basque', |
|
| 132 | - 'be' => 'Belarusian', |
|
| 133 | - 'bn' => 'Bengali', |
|
| 134 | - 'bh' => 'Bihari', |
|
| 135 | - 'bi' => 'Bislama', |
|
| 136 | - 'bs' => 'Bosnian', |
|
| 137 | - 'br' => 'Breton', |
|
| 138 | - 'bg' => 'Bulgarian', |
|
| 139 | - 'my' => 'Burmese', |
|
| 140 | - 'ca' => 'Catalan; Valencian', |
|
| 141 | - 'ch' => 'Chamorro', |
|
| 142 | - 'ce' => 'Chechen', |
|
| 143 | - 'zh' => 'Chinese', |
|
| 144 | - 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', |
|
| 145 | - 'cv' => 'Chuvash', |
|
| 146 | - 'kw' => 'Cornish', |
|
| 147 | - 'co' => 'Corsican', |
|
| 148 | - 'cr' => 'Cree', |
|
| 149 | - 'cs' => 'Czech', |
|
| 150 | - 'da' => 'Danish', |
|
| 151 | - 'dv' => 'Divehi; Dhivehi; Maldivian', |
|
| 152 | - 'nl' => 'Dutch; Flemish', |
|
| 153 | - 'dz' => 'Dzongkha', |
|
| 154 | - 'en' => 'English', |
|
| 155 | - 'eo' => 'Esperanto', |
|
| 156 | - 'et' => 'Estonian', |
|
| 157 | - 'ee' => 'Ewe', |
|
| 158 | - 'fo' => 'Faroese', |
|
| 159 | - 'fj' => 'Fijjian', |
|
| 160 | - 'fi' => 'Finnish', |
|
| 161 | - 'fr' => 'French', |
|
| 162 | - 'fy' => 'Western Frisian', |
|
| 163 | - 'ff' => 'Fulah', |
|
| 164 | - 'ka' => 'Georgian', |
|
| 165 | - 'de' => 'German', |
|
| 166 | - 'gd' => 'Gaelic; Scottish Gaelic', |
|
| 167 | - 'ga' => 'Irish', |
|
| 168 | - 'gl' => 'Galician', |
|
| 169 | - 'gv' => 'Manx', |
|
| 170 | - 'el' => 'Greek, Modern', |
|
| 171 | - 'gn' => 'Guarani', |
|
| 172 | - 'gu' => 'Gujarati', |
|
| 173 | - 'ht' => 'Haitian; Haitian Creole', |
|
| 174 | - 'ha' => 'Hausa', |
|
| 175 | - 'he' => 'Hebrew', |
|
| 176 | - 'hz' => 'Herero', |
|
| 177 | - 'hi' => 'Hindi', |
|
| 178 | - 'ho' => 'Hiri Motu', |
|
| 179 | - 'hu' => 'Hungarian', |
|
| 180 | - 'ig' => 'Igbo', |
|
| 181 | - 'is' => 'Icelandic', |
|
| 182 | - 'io' => 'Ido', |
|
| 183 | - 'ii' => 'Sichuan Yi', |
|
| 184 | - 'iu' => 'Inuktitut', |
|
| 185 | - 'ie' => 'Interlingue', |
|
| 186 | - 'ia' => 'Interlingua (International Auxiliary Language Association)', |
|
| 187 | - 'id' => 'Indonesian', |
|
| 188 | - 'ik' => 'Inupiaq', |
|
| 189 | - 'it' => 'Italian', |
|
| 190 | - 'jv' => 'Javanese', |
|
| 191 | - 'ja' => 'Japanese', |
|
| 192 | - 'kl' => 'Kalaallisut; Greenlandic', |
|
| 193 | - 'kn' => 'Kannada', |
|
| 194 | - 'ks' => 'Kashmiri', |
|
| 195 | - 'kr' => 'Kanuri', |
|
| 196 | - 'kk' => 'Kazakh', |
|
| 197 | - 'km' => 'Central Khmer', |
|
| 198 | - 'ki' => 'Kikuyu; Gikuyu', |
|
| 199 | - 'rw' => 'Kinyarwanda', |
|
| 200 | - 'ky' => 'Kirghiz; Kyrgyz', |
|
| 201 | - 'kv' => 'Komi', |
|
| 202 | - 'kg' => 'Kongo', |
|
| 203 | - 'ko' => 'Korean', |
|
| 204 | - 'kj' => 'Kuanyama; Kwanyama', |
|
| 205 | - 'ku' => 'Kurdish', |
|
| 206 | - 'lo' => 'Lao', |
|
| 207 | - 'la' => 'Latin', |
|
| 208 | - 'lv' => 'Latvian', |
|
| 209 | - 'li' => 'Limburgan; Limburger; Limburgish', |
|
| 210 | - 'ln' => 'Lingala', |
|
| 211 | - 'lt' => 'Lithuanian', |
|
| 212 | - 'lb' => 'Luxembourgish; Letzeburgesch', |
|
| 213 | - 'lu' => 'Luba-Katanga', |
|
| 214 | - 'lg' => 'Ganda', |
|
| 215 | - 'mk' => 'Macedonian', |
|
| 216 | - 'mh' => 'Marshallese', |
|
| 217 | - 'ml' => 'Malayalam', |
|
| 218 | - 'mi' => 'Maori', |
|
| 219 | - 'mr' => 'Marathi', |
|
| 220 | - 'ms' => 'Malay', |
|
| 221 | - 'mg' => 'Malagasy', |
|
| 222 | - 'mt' => 'Maltese', |
|
| 223 | - 'mo' => 'Moldavian', |
|
| 224 | - 'mn' => 'Mongolian', |
|
| 225 | - 'na' => 'Nauru', |
|
| 226 | - 'nv' => 'Navajo; Navaho', |
|
| 227 | - 'nr' => 'Ndebele, South; South Ndebele', |
|
| 228 | - 'nd' => 'Ndebele, North; North Ndebele', |
|
| 229 | - 'ng' => 'Ndonga', |
|
| 230 | - 'ne' => 'Nepali', |
|
| 231 | - 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', |
|
| 232 | - 'nb' => 'Bokmål, Norwegian, Norwegian Bokmål', |
|
| 233 | - 'no' => 'Norwegian', |
|
| 234 | - 'ny' => 'Chichewa; Chewa; Nyanja', |
|
| 235 | - 'oc' => 'Occitan, Provençal', |
|
| 236 | - 'oj' => 'Ojibwa', |
|
| 237 | - 'or' => 'Oriya', |
|
| 238 | - 'om' => 'Oromo', |
|
| 239 | - 'os' => 'Ossetian; Ossetic', |
|
| 240 | - 'pa' => 'Panjabi; Punjabi', |
|
| 241 | - 'fa' => 'Persian', |
|
| 242 | - 'pi' => 'Pali', |
|
| 243 | - 'pl' => 'Polish', |
|
| 244 | - 'pt' => 'Portuguese', |
|
| 245 | - 'ps' => 'Pushto', |
|
| 246 | - 'qu' => 'Quechua', |
|
| 247 | - 'rm' => 'Romansh', |
|
| 248 | - 'ro' => 'Romanian', |
|
| 249 | - 'rn' => 'Rundi', |
|
| 250 | - 'ru' => 'Russian', |
|
| 251 | - 'sg' => 'Sango', |
|
| 252 | - 'sa' => 'Sanskrit', |
|
| 253 | - 'sr' => 'Serbian', |
|
| 254 | - 'hr' => 'Croatian', |
|
| 255 | - 'si' => 'Sinhala; Sinhalese', |
|
| 256 | - 'sk' => 'Slovak', |
|
| 257 | - 'sl' => 'Slovenian', |
|
| 258 | - 'se' => 'Northern Sami', |
|
| 259 | - 'sm' => 'Samoan', |
|
| 260 | - 'sn' => 'Shona', |
|
| 261 | - 'sd' => 'Sindhi', |
|
| 262 | - 'so' => 'Somali', |
|
| 263 | - 'st' => 'Sotho, Southern', |
|
| 264 | - 'es' => 'Spanish; Castilian', |
|
| 265 | - 'sc' => 'Sardinian', |
|
| 266 | - 'ss' => 'Swati', |
|
| 267 | - 'su' => 'Sundanese', |
|
| 268 | - 'sw' => 'Swahili', |
|
| 269 | - 'sv' => 'Swedish', |
|
| 270 | - 'ty' => 'Tahitian', |
|
| 271 | - 'ta' => 'Tamil', |
|
| 272 | - 'tt' => 'Tatar', |
|
| 273 | - 'te' => 'Telugu', |
|
| 274 | - 'tg' => 'Tajik', |
|
| 275 | - 'tl' => 'Tagalog', |
|
| 276 | - 'th' => 'Thai', |
|
| 277 | - 'bo' => 'Tibetan', |
|
| 278 | - 'ti' => 'Tigrinya', |
|
| 279 | - 'to' => 'Tonga (Tonga Islands)', |
|
| 280 | - 'tn' => 'Tswana', |
|
| 281 | - 'ts' => 'Tsonga', |
|
| 282 | - 'tk' => 'Turkmen', |
|
| 283 | - 'tr' => 'Turkish', |
|
| 284 | - 'tw' => 'Twi', |
|
| 285 | - 'ug' => 'Uighur; Uyghur', |
|
| 286 | - 'uk' => 'Ukrainian', |
|
| 287 | - 'ur' => 'Urdu', |
|
| 288 | - 'uz' => 'Uzbek', |
|
| 289 | - 've' => 'Venda', |
|
| 290 | - 'vi' => 'Vietnamese', |
|
| 291 | - 'vo' => 'Volapük', |
|
| 292 | - 'cy' => 'Welsh', |
|
| 293 | - 'wa' => 'Walloon', |
|
| 294 | - 'wo' => 'Wolof', |
|
| 295 | - 'xh' => 'Xhosa', |
|
| 296 | - 'yi' => 'Yiddish', |
|
| 297 | - 'yo' => 'Yoruba', |
|
| 298 | - 'za' => 'Zhuang; Chuang', |
|
| 299 | - 'zu' => 'Zulu' |
|
| 300 | - ); |
|
| 102 | + /** |
|
| 103 | + * Returns the language for a language code. This function is a clone of WP's function provided in `ms.php`. |
|
| 104 | + * |
|
| 105 | + * @since 3.9.3 |
|
| 106 | + * |
|
| 107 | + * @param string $code Optional. The two-letter language code. Default empty. |
|
| 108 | + * |
|
| 109 | + * @return string The language corresponding to $code if it exists. If it does not exist, |
|
| 110 | + * then the first two letters of $code is returned. |
|
| 111 | + */ |
|
| 112 | + private static function format_code_lang( $code = '' ) { |
|
| 113 | + $code = strtolower( substr( $code, 0, 2 ) ); |
|
| 114 | + $lang_codes = array( |
|
| 115 | + 'aa' => 'Afar', |
|
| 116 | + 'ab' => 'Abkhazian', |
|
| 117 | + 'af' => 'Afrikaans', |
|
| 118 | + 'ak' => 'Akan', |
|
| 119 | + 'sq' => 'Albanian', |
|
| 120 | + 'am' => 'Amharic', |
|
| 121 | + 'ar' => 'Arabic', |
|
| 122 | + 'an' => 'Aragonese', |
|
| 123 | + 'hy' => 'Armenian', |
|
| 124 | + 'as' => 'Assamese', |
|
| 125 | + 'av' => 'Avaric', |
|
| 126 | + 'ae' => 'Avestan', |
|
| 127 | + 'ay' => 'Aymara', |
|
| 128 | + 'az' => 'Azerbaijani', |
|
| 129 | + 'ba' => 'Bashkir', |
|
| 130 | + 'bm' => 'Bambara', |
|
| 131 | + 'eu' => 'Basque', |
|
| 132 | + 'be' => 'Belarusian', |
|
| 133 | + 'bn' => 'Bengali', |
|
| 134 | + 'bh' => 'Bihari', |
|
| 135 | + 'bi' => 'Bislama', |
|
| 136 | + 'bs' => 'Bosnian', |
|
| 137 | + 'br' => 'Breton', |
|
| 138 | + 'bg' => 'Bulgarian', |
|
| 139 | + 'my' => 'Burmese', |
|
| 140 | + 'ca' => 'Catalan; Valencian', |
|
| 141 | + 'ch' => 'Chamorro', |
|
| 142 | + 'ce' => 'Chechen', |
|
| 143 | + 'zh' => 'Chinese', |
|
| 144 | + 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', |
|
| 145 | + 'cv' => 'Chuvash', |
|
| 146 | + 'kw' => 'Cornish', |
|
| 147 | + 'co' => 'Corsican', |
|
| 148 | + 'cr' => 'Cree', |
|
| 149 | + 'cs' => 'Czech', |
|
| 150 | + 'da' => 'Danish', |
|
| 151 | + 'dv' => 'Divehi; Dhivehi; Maldivian', |
|
| 152 | + 'nl' => 'Dutch; Flemish', |
|
| 153 | + 'dz' => 'Dzongkha', |
|
| 154 | + 'en' => 'English', |
|
| 155 | + 'eo' => 'Esperanto', |
|
| 156 | + 'et' => 'Estonian', |
|
| 157 | + 'ee' => 'Ewe', |
|
| 158 | + 'fo' => 'Faroese', |
|
| 159 | + 'fj' => 'Fijjian', |
|
| 160 | + 'fi' => 'Finnish', |
|
| 161 | + 'fr' => 'French', |
|
| 162 | + 'fy' => 'Western Frisian', |
|
| 163 | + 'ff' => 'Fulah', |
|
| 164 | + 'ka' => 'Georgian', |
|
| 165 | + 'de' => 'German', |
|
| 166 | + 'gd' => 'Gaelic; Scottish Gaelic', |
|
| 167 | + 'ga' => 'Irish', |
|
| 168 | + 'gl' => 'Galician', |
|
| 169 | + 'gv' => 'Manx', |
|
| 170 | + 'el' => 'Greek, Modern', |
|
| 171 | + 'gn' => 'Guarani', |
|
| 172 | + 'gu' => 'Gujarati', |
|
| 173 | + 'ht' => 'Haitian; Haitian Creole', |
|
| 174 | + 'ha' => 'Hausa', |
|
| 175 | + 'he' => 'Hebrew', |
|
| 176 | + 'hz' => 'Herero', |
|
| 177 | + 'hi' => 'Hindi', |
|
| 178 | + 'ho' => 'Hiri Motu', |
|
| 179 | + 'hu' => 'Hungarian', |
|
| 180 | + 'ig' => 'Igbo', |
|
| 181 | + 'is' => 'Icelandic', |
|
| 182 | + 'io' => 'Ido', |
|
| 183 | + 'ii' => 'Sichuan Yi', |
|
| 184 | + 'iu' => 'Inuktitut', |
|
| 185 | + 'ie' => 'Interlingue', |
|
| 186 | + 'ia' => 'Interlingua (International Auxiliary Language Association)', |
|
| 187 | + 'id' => 'Indonesian', |
|
| 188 | + 'ik' => 'Inupiaq', |
|
| 189 | + 'it' => 'Italian', |
|
| 190 | + 'jv' => 'Javanese', |
|
| 191 | + 'ja' => 'Japanese', |
|
| 192 | + 'kl' => 'Kalaallisut; Greenlandic', |
|
| 193 | + 'kn' => 'Kannada', |
|
| 194 | + 'ks' => 'Kashmiri', |
|
| 195 | + 'kr' => 'Kanuri', |
|
| 196 | + 'kk' => 'Kazakh', |
|
| 197 | + 'km' => 'Central Khmer', |
|
| 198 | + 'ki' => 'Kikuyu; Gikuyu', |
|
| 199 | + 'rw' => 'Kinyarwanda', |
|
| 200 | + 'ky' => 'Kirghiz; Kyrgyz', |
|
| 201 | + 'kv' => 'Komi', |
|
| 202 | + 'kg' => 'Kongo', |
|
| 203 | + 'ko' => 'Korean', |
|
| 204 | + 'kj' => 'Kuanyama; Kwanyama', |
|
| 205 | + 'ku' => 'Kurdish', |
|
| 206 | + 'lo' => 'Lao', |
|
| 207 | + 'la' => 'Latin', |
|
| 208 | + 'lv' => 'Latvian', |
|
| 209 | + 'li' => 'Limburgan; Limburger; Limburgish', |
|
| 210 | + 'ln' => 'Lingala', |
|
| 211 | + 'lt' => 'Lithuanian', |
|
| 212 | + 'lb' => 'Luxembourgish; Letzeburgesch', |
|
| 213 | + 'lu' => 'Luba-Katanga', |
|
| 214 | + 'lg' => 'Ganda', |
|
| 215 | + 'mk' => 'Macedonian', |
|
| 216 | + 'mh' => 'Marshallese', |
|
| 217 | + 'ml' => 'Malayalam', |
|
| 218 | + 'mi' => 'Maori', |
|
| 219 | + 'mr' => 'Marathi', |
|
| 220 | + 'ms' => 'Malay', |
|
| 221 | + 'mg' => 'Malagasy', |
|
| 222 | + 'mt' => 'Maltese', |
|
| 223 | + 'mo' => 'Moldavian', |
|
| 224 | + 'mn' => 'Mongolian', |
|
| 225 | + 'na' => 'Nauru', |
|
| 226 | + 'nv' => 'Navajo; Navaho', |
|
| 227 | + 'nr' => 'Ndebele, South; South Ndebele', |
|
| 228 | + 'nd' => 'Ndebele, North; North Ndebele', |
|
| 229 | + 'ng' => 'Ndonga', |
|
| 230 | + 'ne' => 'Nepali', |
|
| 231 | + 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', |
|
| 232 | + 'nb' => 'Bokmål, Norwegian, Norwegian Bokmål', |
|
| 233 | + 'no' => 'Norwegian', |
|
| 234 | + 'ny' => 'Chichewa; Chewa; Nyanja', |
|
| 235 | + 'oc' => 'Occitan, Provençal', |
|
| 236 | + 'oj' => 'Ojibwa', |
|
| 237 | + 'or' => 'Oriya', |
|
| 238 | + 'om' => 'Oromo', |
|
| 239 | + 'os' => 'Ossetian; Ossetic', |
|
| 240 | + 'pa' => 'Panjabi; Punjabi', |
|
| 241 | + 'fa' => 'Persian', |
|
| 242 | + 'pi' => 'Pali', |
|
| 243 | + 'pl' => 'Polish', |
|
| 244 | + 'pt' => 'Portuguese', |
|
| 245 | + 'ps' => 'Pushto', |
|
| 246 | + 'qu' => 'Quechua', |
|
| 247 | + 'rm' => 'Romansh', |
|
| 248 | + 'ro' => 'Romanian', |
|
| 249 | + 'rn' => 'Rundi', |
|
| 250 | + 'ru' => 'Russian', |
|
| 251 | + 'sg' => 'Sango', |
|
| 252 | + 'sa' => 'Sanskrit', |
|
| 253 | + 'sr' => 'Serbian', |
|
| 254 | + 'hr' => 'Croatian', |
|
| 255 | + 'si' => 'Sinhala; Sinhalese', |
|
| 256 | + 'sk' => 'Slovak', |
|
| 257 | + 'sl' => 'Slovenian', |
|
| 258 | + 'se' => 'Northern Sami', |
|
| 259 | + 'sm' => 'Samoan', |
|
| 260 | + 'sn' => 'Shona', |
|
| 261 | + 'sd' => 'Sindhi', |
|
| 262 | + 'so' => 'Somali', |
|
| 263 | + 'st' => 'Sotho, Southern', |
|
| 264 | + 'es' => 'Spanish; Castilian', |
|
| 265 | + 'sc' => 'Sardinian', |
|
| 266 | + 'ss' => 'Swati', |
|
| 267 | + 'su' => 'Sundanese', |
|
| 268 | + 'sw' => 'Swahili', |
|
| 269 | + 'sv' => 'Swedish', |
|
| 270 | + 'ty' => 'Tahitian', |
|
| 271 | + 'ta' => 'Tamil', |
|
| 272 | + 'tt' => 'Tatar', |
|
| 273 | + 'te' => 'Telugu', |
|
| 274 | + 'tg' => 'Tajik', |
|
| 275 | + 'tl' => 'Tagalog', |
|
| 276 | + 'th' => 'Thai', |
|
| 277 | + 'bo' => 'Tibetan', |
|
| 278 | + 'ti' => 'Tigrinya', |
|
| 279 | + 'to' => 'Tonga (Tonga Islands)', |
|
| 280 | + 'tn' => 'Tswana', |
|
| 281 | + 'ts' => 'Tsonga', |
|
| 282 | + 'tk' => 'Turkmen', |
|
| 283 | + 'tr' => 'Turkish', |
|
| 284 | + 'tw' => 'Twi', |
|
| 285 | + 'ug' => 'Uighur; Uyghur', |
|
| 286 | + 'uk' => 'Ukrainian', |
|
| 287 | + 'ur' => 'Urdu', |
|
| 288 | + 'uz' => 'Uzbek', |
|
| 289 | + 've' => 'Venda', |
|
| 290 | + 'vi' => 'Vietnamese', |
|
| 291 | + 'vo' => 'Volapük', |
|
| 292 | + 'cy' => 'Welsh', |
|
| 293 | + 'wa' => 'Walloon', |
|
| 294 | + 'wo' => 'Wolof', |
|
| 295 | + 'xh' => 'Xhosa', |
|
| 296 | + 'yi' => 'Yiddish', |
|
| 297 | + 'yo' => 'Yoruba', |
|
| 298 | + 'za' => 'Zhuang; Chuang', |
|
| 299 | + 'zu' => 'Zulu' |
|
| 300 | + ); |
|
| 301 | 301 | |
| 302 | - /** |
|
| 303 | - * Filters the language codes. |
|
| 304 | - * |
|
| 305 | - * @since MU |
|
| 306 | - * |
|
| 307 | - * @param array $lang_codes Key/value pair of language codes where key is the short version. |
|
| 308 | - * @param string $code A two-letter designation of the language. |
|
| 309 | - */ |
|
| 310 | - $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); |
|
| 302 | + /** |
|
| 303 | + * Filters the language codes. |
|
| 304 | + * |
|
| 305 | + * @since MU |
|
| 306 | + * |
|
| 307 | + * @param array $lang_codes Key/value pair of language codes where key is the short version. |
|
| 308 | + * @param string $code A two-letter designation of the language. |
|
| 309 | + */ |
|
| 310 | + $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); |
|
| 311 | 311 | |
| 312 | - return strtr( $code, $lang_codes ); |
|
| 313 | - } |
|
| 312 | + return strtr( $code, $lang_codes ); |
|
| 313 | + } |
|
| 314 | 314 | |
| 315 | 315 | } |