Changeset 2043391
- Timestamp:
- 03/03/2019 06:50:14 PM (7 years ago)
- Location:
- xo-for-angular/trunk/Includes
- Files:
-
- 7 edited
-
Options/Tabs/General/AcfTab.class.php (modified) (2 diffs)
-
Options/Tabs/General/ApiTab.class.php (modified) (5 diffs)
-
Options/Tabs/General/PostsTab.class.php (modified) (4 diffs)
-
Options/Tabs/General/RoutingTab.class.php (modified) (4 diffs)
-
Options/Tabs/General/TemplatesTab.class.php (modified) (4 diffs)
-
Services/Classes/AdminNotice.class.php (modified) (1 diff)
-
Xo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
xo-for-angular/trunk/Includes/Options/Tabs/General/AcfTab.class.php
r2043256 r2043391 19 19 } 20 20 21 function InitAllowedSection() { 21 /** 22 * Settings section for configuring allowed ACF field groups. 23 * 24 * @since 1.0.0 25 * 26 * @return void 27 */ 28 private function InitAllowedSection() { 22 29 $this->AddSettingsSection( 23 30 'acf_allowed_section', … … 30 37 } 31 38 32 function AddAllowedSectionAllowedGroupsSetting($section) { 39 /** 40 * Settings field for Allowed Groups. 41 * Used to allow specified ACF groups through the Xo API. 42 * 43 * @since 1.0.0 44 * 45 * @param string $section Name of the section. 46 * @return void 47 */ 48 private function AddAllowedSectionAllowedGroupsSetting($section) { 33 49 $option = 'xo_acf_allowed_groups'; 34 50 $value = $this->Xo->Services->Options->GetOption($option, array()); -
xo-for-angular/trunk/Includes/Options/Tabs/General/ApiTab.class.php
r2043256 r2043391 11 11 * @var XoServiceAdminNotice 12 12 */ 13 var$RewritesNeedUpdatingNotice;13 private $RewritesNeedUpdatingNotice; 14 14 15 15 /** … … 72 72 }, 73 73 function ($oldValue, $newValue, $option) { 74 $this->UpdatedApiSetting($oldValue, $newValue, $option); 74 if ($oldValue !== $newValue) 75 $this->RewritesNeedUpdatingNotice->RegisterNotice(); 75 76 } 76 77 ); … … 98 99 }, 99 100 function ($oldValue, $newValue, $option) { 100 $this->UpdatedApiSetting($oldValue, $newValue, $option); 101 if ($oldValue !== $newValue) 102 $this->RewritesNeedUpdatingNotice->RegisterNotice(); 101 103 } 102 104 ); … … 201 203 } 202 204 203 function UpdatedApiSetting($oldValue, $newValue, $option) { 204 if ($oldValue !== $newValue) { 205 $this->RewritesNeedUpdatingNotice->RegisterNotice(); 206 } 207 } 208 209 function RewritesNeedUpdatingNoticeRender($settings) { 205 /** 206 * Render the rewrites need updating notice when registered. 207 * 208 * @since 1.0.0 209 * 210 * @param array $settings Additional data passed to the notice render. 211 * @return string Output of the admin notice 212 */ 213 public function RewritesNeedUpdatingNoticeRender($settings) { 210 214 $output = '<p><strong>' . sprintf( 211 215 __('%s API settings updated, please %s now.', 'xo'), … … 221 225 } 222 226 223 function DoAction() { 227 /** 228 * Handle additional actions on the API tab. 229 * 230 * @since 1.0.0 231 * 232 * @return void 233 */ 234 private function DoAction() { 224 235 if (empty($_GET['action'])) 225 236 return; -
xo-for-angular/trunk/Includes/Options/Tabs/General/PostsTab.class.php
r2043256 r2043391 20 20 } 21 21 22 function InitPostPageSection() { 22 /** 23 * Settings section for configuring Post type roots. 24 * 25 * @since 1.0.0 26 * 27 * @return void 28 */ 29 private function InitPostPageSection() { 23 30 $this->AddSettingsSection( 24 31 'post_page_section', … … 38 45 } 39 46 40 function AddPostPageSettingsField($section, $post_type, $post_type_config) { 47 /** 48 * Settings field for Post Page. 49 * Used when generating nested routes based on a page serving as the root of a custom post type. 50 * 51 * @since 1.0.0 52 * 53 * @param string $section Name of the section. 54 * @param string $post_type Post type slug. 55 * @param WP_Post_Type $post_type_config Post type object. 56 * @return void 57 */ 58 private function AddPostPageSettingsField($section, $post_type, $post_type_config) { 41 59 $this->AddSettingsField( 42 60 $section, … … 56 74 } 57 75 58 function InitPostTemplateSection() { 76 /** 77 * Settings section for configuring Post type templates. 78 * 79 * @since 1.0.0 80 * 81 * @return void 82 */ 83 private function InitPostTemplateSection() { 59 84 $this->AddSettingsSection( 60 85 'post_template_section', … … 74 99 } 75 100 76 function AddPostTemplateSettingsField($section, $post_type, $post_type_config) { 101 /** 102 * Settings field for Post Template. 103 * Used to set the template used for a single custom post type. 104 * 105 * @since 1.0.0 106 * 107 * @param string $section Name of the section. 108 * @param string $post_type Post type slug. 109 * @param WP_Post_Type $post_type_config Post type object. 110 * @return void 111 */ 112 private function AddPostTemplateSettingsField($section, $post_type, $post_type_config) { 77 113 $this->AddSettingsField( 78 114 $section, -
xo-for-angular/trunk/Includes/Options/Tabs/General/RoutingTab.class.php
r2043256 r2043391 20 20 } 21 21 22 function InitPreviewsSection() { 22 /** 23 * Settings section for configuring page drafts and previews. 24 * 25 * @since 1.0.0 26 * 27 * @return void 28 */ 29 private function InitPreviewsSection() { 23 30 $this->AddSettingsSection( 24 31 'routing_previews_section', … … 31 38 } 32 39 33 function AddPreviewsSectionPreviewsEnabledSetting($section) { 40 /** 41 * Settings field for Previews Enabled. 42 * Used when generating routes to include drafts and previews. 43 * 44 * @since 1.0.0 45 * 46 * @param string $section Name of the section. 47 * @return void 48 */ 49 private function AddPreviewsSectionPreviewsEnabledSetting($section) { 34 50 $this->AddSettingsField( 35 51 $section, … … 45 61 } 46 62 47 function InitErrorsSection() { 63 /** 64 * Settings section for configuring how to handle various routing errors. 65 * 66 * @since 1.0.0 67 * 68 * @return void 69 */ 70 private function InitErrorsSection() { 48 71 $this->AddSettingsSection( 49 72 'routing_errors_section', … … 56 79 } 57 80 58 function AddErrorsSection404PageSetting($section) { 81 /** 82 * Settings field for 404 Page. 83 * Used when generating routes to indicate a page which is shown for routes which have no match. 84 * 85 * @since 1.0.0 86 * 87 * @param string $section Name of the section. 88 * @return void 89 */ 90 private function AddErrorsSection404PageSetting($section) { 59 91 $this->AddSettingsField( 60 92 $section, -
xo-for-angular/trunk/Includes/Options/Tabs/General/TemplatesTab.class.php
r2043256 r2043391 19 19 } 20 20 21 function InitReaderSection() { 21 /** 22 * Settings section for configuring various options for the Template Reader. 23 * 24 * @since 1.0.0 25 * 26 * @return void 27 */ 28 private function InitReaderSection() { 22 29 $this->AddSettingsSection( 23 30 'templates_reader_section', … … 32 39 } 33 40 34 function AddReaderSectionReaderEnabledSetting($section) { 41 /** 42 * Settings field for Reader Enabled. 43 * Used to enable the Template Reader. 44 * 45 * @since 1.0.0 46 * 47 * @param string $section Name of the section. 48 * @return void 49 */ 50 private function AddReaderSectionReaderEnabledSetting($section) { 35 51 $this->AddSettingsField( 36 52 $section, … … 46 62 } 47 63 48 function AddReaderSectionCacheEnabledSetting($section) { 64 /** 65 * Settings field for Cache Enabled. 66 * Used to enable the caching of templates from the Template Reader. 67 * 68 * @since 1.0.0 69 * 70 * @param string $section Name of the section. 71 * @return void 72 */ 73 private function AddReaderSectionCacheEnabledSetting($section) { 49 74 $this->AddSettingsField( 50 75 $section, … … 64 89 } 65 90 66 function AddReaderSectionTemplatesPathSetting($section) { 91 /** 92 * Settings field for Templates Path. 93 * Used to set the base path for reading templates. 94 * 95 * @since 1.0.0 96 * 97 * @param string $section Name of the section. 98 * @return void 99 */ 100 private function AddReaderSectionTemplatesPathSetting($section) { 67 101 $this->AddSettingsField( 68 102 $section, -
xo-for-angular/trunk/Includes/Services/Classes/AdminNotice.class.php
r2042983 r2043391 46 46 * @since 1.0.0 47 47 * 48 * @param mixed$settings Additional data passed to the notice such as the expiration.48 * @param array $settings Additional data passed to the notice such as the expiration. 49 49 */ 50 50 function RegisterNotice($settings = array()) { -
xo-for-angular/trunk/Includes/Xo.php
r2042983 r2043391 17 17 * @var string 18 18 */ 19 public $plugin = 'xo- angular/xo-angular.php';19 public $plugin = 'xo-for-angular/xo-angular.php'; 20 20 21 21 /**
Note: See TracChangeset
for help on using the changeset viewer.