| @@ -1,73 +1,75 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace Photonic_Plugin\Options; |
| 3 | -use Photonic_Plugin\Core\Photonic; | |
| 4 | + | |
| 4 | 5 | use Photonic_Plugin\Core\Utilities; |
| 5 | 6 | |
| 6 | 7 | class Instagram extends Option_Tab { |
| 7 | - private static $instance; | |
| 8 | - | |
| 9 | - private function __construct() { | |
| 8 | + protected function __construct() { | |
| 10 | 9 | $this->options = [ |
| 11 | - ['name' => "Instagram settings", | |
| 12 | - 'desc' => "Control settings for Instagram", | |
| 13 | - 'category' => "instagram-settings", | |
| 14 | - 'type' => 'section',], | |
| 10 | + [ | |
| 11 | + 'name' => 'Instagram settings', | |
| 12 | + 'desc' => 'Control settings for Instagram', | |
| 13 | + 'category' => 'instagram-settings', | |
| 14 | + 'type' => 'section', | |
| 15 | + ], | |
| 15 | 16 | |
| 16 | - ['name' => "Instagram Access Token", | |
| 17 | - 'desc' => "Enter your Instagram Access Token. You can get this from <em>Photonic → Authentication</em> by clicking on <em>Login and get Access Token</em>", | |
| 18 | - 'id' => "instagram_access_token", | |
| 19 | - 'grouping' => "instagram-settings", | |
| 20 | - 'type' => 'text'], | |
| 17 | + [ | |
| 18 | + 'name' => "Instagram Update", | |
| 19 | + 'desc' => "With effect from September 2022, Meta has blocked its API for individual developers, and only allows registered businesses. | |
| 20 | + As Photonic is developed by an individual, unfortunately Instagram can no longer be supported. Please switch to a business-supported plugin if you wish to use Instagram as a source for your galleries.", | |
| 21 | + 'grouping' => 'instagram-settings', | |
| 22 | + 'type' => 'blurb', | |
| 23 | + ], | |
| 21 | 24 | |
| 22 | - ['name' => 'Media to show', | |
| 23 | - 'desc' => 'You can choose to include photos as well as videos in your output. This can be overridden by the <code>media</code> parameter in the shortcode:', | |
| 24 | - 'id' => "instagram_media", | |
| 25 | - 'grouping' => "instagram-settings", | |
| 26 | - 'type' => 'select', | |
| 27 | - 'options' => Utilities::media_options()], | |
| 25 | + /* | |
| 26 | + [ | |
| 27 | + 'name' => 'Instagram Access Token', | |
| 28 | + 'desc' => "Enter your Instagram Access Token. You can get this from <em>Photonic → Authentication</em> by clicking on <em>Login and get Access Token</em>", | |
| 29 | + 'id' => 'instagram_access_token', | |
| 30 | + 'grouping' => 'instagram-settings', | |
| 31 | + 'type' => 'text' | |
| 32 | + ], | |
| 28 | 33 | |
| 29 | - ['name' => "Disable lightbox linking", | |
| 30 | - 'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page.", | |
| 31 | - 'id' => "instagram_disable_title_link", | |
| 32 | - 'grouping' => "instagram-settings", | |
| 33 | - 'type' => 'checkbox'], | |
| 34 | + [ | |
| 35 | + 'name' => 'Media to show', | |
| 36 | + 'desc' => 'You can choose to include photos as well as videos in your output. This can be overridden by the <code>media</code> parameter in the shortcode:', | |
| 37 | + 'id' => 'instagram_media', | |
| 38 | + 'grouping' => 'instagram-settings', | |
| 39 | + 'type' => 'select', | |
| 40 | + 'options' => Utilities::media_options() | |
| 41 | + ], | |
| 34 | 42 | |
| 35 | - ['name' => "Title Display", | |
| 36 | - 'desc' => "How do you want the title of the photo thumbnail?", | |
| 37 | - 'id' => "instagram_photo_title_display", | |
| 38 | - 'grouping' => "instagram-settings", | |
| 39 | - 'type' => 'radio', | |
| 40 | - 'options' => $this->title_styles()], | |
| 43 | + [ | |
| 44 | + 'name' => 'Disable lightbox linking', | |
| 45 | + 'desc' => 'Check this to disable linking the photo title in the lightbox to the original photo page.', | |
| 46 | + 'id' => 'instagram_disable_title_link', | |
| 47 | + 'grouping' => 'instagram-settings', | |
| 48 | + 'type' => 'checkbox' | |
| 49 | + ], | |
| 41 | 50 | |
| 42 | - ['name' => "Constrain Photos Per Row", | |
| 43 | - 'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.", | |
| 44 | - 'id' => "instagram_photos_per_row_constraint", | |
| 45 | - 'grouping' => "instagram-settings", | |
| 46 | - 'type' => 'select', | |
| 47 | - 'options' => ["padding" => "Fix the padding around the thumbnails", | |
| 48 | - "count" => "Fix the number of thumbnails per row", | |
| 49 | - ]], | |
| 51 | + [ | |
| 52 | + 'name' => 'Caption positioning for carousels / posts', | |
| 53 | + 'desc' => "Instagram carousels (posts) don't have a caption for each individual photo, rather the caption is for the post itself. Where do want the caption to show while displaying the carousel? You can override this for each shortcode individually.", | |
| 54 | + 'id' => 'instagram_carousel_caption_position', | |
| 55 | + 'grouping' => 'instagram-settings', | |
| 56 | + 'type' => 'select', | |
| 57 | + 'options' => [ | |
| 58 | + 'none' => 'Do not show the caption', | |
| 59 | + 'above' => 'Show above the photos', | |
| 60 | + 'below' => 'Show below the photos', | |
| 61 | + ] | |
| 62 | + ], | |
| 50 | 63 | |
| 51 | - ['name' => "Constrain by padding", | |
| 52 | - 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", | |
| 53 | - 'id' => "instagram_photos_constrain_by_padding", | |
| 54 | - 'grouping' => "instagram-settings", | |
| 55 | - 'type' => 'text', | |
| 56 | - 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."], | |
| 57 | - | |
| 58 | - ['name' => "Constrain by number of thumbnails", | |
| 59 | - 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails", | |
| 60 | - 'id' => "instagram_photos_constrain_by_count", | |
| 61 | - 'grouping' => "instagram-settings", | |
| 62 | - 'type' => 'select', | |
| 63 | - 'options' => $this->selection_range(1, 25)], | |
| 64 | + [ | |
| 65 | + 'name' => 'Title Display', | |
| 66 | + 'desc' => 'How do you want the title of the photo thumbnail?', | |
| 67 | + 'id' => 'instagram_photo_title_display', | |
| 68 | + 'grouping' => 'instagram-settings', | |
| 69 | + 'type' => 'radio', | |
| 70 | + 'options' => $this->title_styles() | |
| 71 | + ], | |
| 72 | + */ | |
| 64 | 73 | ]; |
| 65 | - } | |
| 66 | - | |
| 67 | - public static function get_instance() { | |
| 68 | - if (self::$instance == null) { | |
| 69 | - self::$instance = new Instagram(); | |
| 70 | - } | |
| 71 | - return self::$instance; | |
| 72 | 74 | } |
| 73 | 75 | } |