-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Plugin Improvement #8074
Comments
Thank you for the feedback, @NenadObradovic!
|
Hi Pento, You are welcome :) 3 and 5. I created a new tickets for these suggestions. Best regards, |
Looks like this has already been split into separate issues. Closing. |
Hi Guys,
I have few suggestions:
Inside main plugin file gutenberg.php could you set these labels to be translatable?
add_menu_page( 'Gutenberg', 'Gutenberg', 'edit_posts', 'gutenberg', 'the_gutenberg_project', 'dashicons-edit' );
to be
add_menu_page( __( 'Gutenberg', 'gutenberg' ), __( 'Gutenberg', 'gutenberg' ), 'edit_posts', 'gutenberg', 'the_gutenberg_project', 'dashicons-edit' );
Inside same file, I think better solution is to split code from text
echo __( 'Gutenberg development mode requires files to be built. Run <code>npm install</code> to install dependencies, <code>npm run build</code> to build the files or <code>npm run dev</code> to build the files and watch for changes. Read the <a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">contributing</a> file for more information.', 'gutenberg' );
to be
echo sprintf( __( 'Gutenberg development mode requires files to be built. Run %s to install dependencies, %s to build the files or %s to build the files and watch for changes. Read the %s file for more information.', 'gutenberg' ), '<code>' . __( 'npm install', 'gutenberg' ) . '</code>', '<code>' . __( 'npm run build', 'gutenberg' ) . '</code>', '<code>' . __( 'npm run dev', 'gutenberg' ) . '</code>', '<a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">' . __( 'contributing', 'gutenberg' ) . '</a>' );
Inside blocks.php file what you think to add filter hooks on several places where you return the value so developer can easily hooks your functions and modify for their purpose.
Inside meta-box-partial-page.php I think you can escape the plugin name, because some plugin can cause error if they have special character
printf( __( 'Gutenberg incompatible meta box, from the "%s" plugin.', 'gutenberg' ), $plugin['Name'] );
for example to be
printf( __( 'Gutenberg incompatible meta box, from the "%s" plugin.', 'gutenberg' ), esc_attr( $plugin['Name'] ) );
I read several posts about incorrect order of hooks admin_enqueue_scripts and add_meta_boxes when gutenberg plugin is active, so I wonder if it will stay in reverse order or your working on that to find solution to set these actions in the default order? Because if it's stay I think it will be cool that you fill some notice or add in documentation as FAQ so that developers could add a conditional in their project when plugin is active to change order of inclusion.
In my case I have some function which dynamically register meta boxes and if my meta boxes exist at the end of that function I called admin_enqueue_scripts hook to include dynamically corresponding style for it, because of this situation scripts are not loaded.
Nenad
The text was updated successfully, but these errors were encountered: