Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild the usage of acf_add_options_page() in ACF.php #8

Open
cleverington opened this issue Jun 4, 2022 · 0 comments
Open

Rebuild the usage of acf_add_options_page() in ACF.php #8

cleverington opened this issue Jun 4, 2022 · 0 comments

Comments

@cleverington
Copy link
Owner

Not happy with it.

Its not OOP. You've got 'functional' code sitting alongside 'config' settings in a dumb way.

Not to mention that we shoe-horned the function altogether into the run() on ACF.php. It should be a stand-alone static function which, possibly, pulls from a 'config only' chunk of code.

In addition, there's no example and/or usage of acf_add_options_sub_page(), which is possibly one of the most useful features of the options pages.

Same for adding an example of adding a c-type specific options page:

<?php
       /**
	 * Custom Post Type Options Pages
	 */
	acf_add_options_page(
		// Add 'Example' Post Type Options Page.
		array(
			'page_title'  => 'Example Options',
			'menu_title'  => 'ExampleOptions',
			'menu_slug'   => 'options_example',
			'capability'  => 'edit_posts',
			'parent_slug' => 'edit.php?post_type=example',
			'position'    => false,
			'icon_url'    => 'dashicons-images-alt2',
			'redirect'    => false,
		),
	);

Same for "theme" level ACF Settings:

<?php
      /**
	 * Example: Default '404' options page
	 *
	 * @note: This could also be accomplished as a theme setting.
	 */
	acf_add_options_page(
		array(
			'page_title'  => '404 Page Options',
			'parent_slug' => 'themes.php',
		)
	);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant