PluginProbe ʕ •ᴥ•ʔ
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager / 3.32
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager v3.32
trunk 2.1.2.0 3.0.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.31 3.32 3.35 3.36 3.37 3.38
custom-sidebars / inc / integrations / class-custom-sidebars-integration.php
custom-sidebars / inc / integrations Last commit date
class-custom-sidebars-integration-polylang.php 8 years ago class-custom-sidebars-integration-wml.php 7 years ago class-custom-sidebars-integration-wpml.php 8 years ago class-custom-sidebars-integration.php 8 years ago
class-custom-sidebars-integration.php
47 lines
1 <?php
2 /**
3 * Integrate sidebar locations
4 *
5 * @since 3.1.2
6 */
7 abstract class CustomSidebarsIntegration {
8
9 protected $languages = array();
10 protected $key_name = '';
11
12 abstract public function prepare( $tabs );
13 abstract public function replace( $replacements, $options );
14 abstract public function get_location( $req, $defaults );
15
16 /**
17 * It should be abstract static function, but ...
18 * https://bugs.php.net/bug.php?id=53081
19 */
20 public static function instance() {}
21
22 /**
23 * Set languages
24 *
25 * @since 3.1.2
26 *
27 * @param array $options Current save option.
28 * @param string $id Sidebar
29 */
30 public function set_location( $options, $id, $sidebars, $data ) {
31 $options[ $this->key_name ] = array();
32 foreach ( $sidebars as $sb_id ) {
33 if ( isset( $data[ $this->key_name ] ) ) {
34 foreach ( $data[ $this->key_name ] as $sb_id => $value ) {
35 if ( ! isset( $options[ $this->key_name ] ) ) {
36 $options[ $this->key_name ] = array();
37 }
38 foreach ( $value as $lang ) {
39 $options[ $this->key_name ][ $lang ][ $sb_id ] = $id;
40 }
41 }
42 }
43 }
44 return $options;
45 }
46 };
47