wrip
Forum Replies Created
-
Forum: Plugins
In reply to: [Redirection] Giving access to Editors to a specific group only@johnny5 I had a look at the developer page. It doesn’t look like I can grant permissions to the Editors to have access to only a certain group within the plugin. E.g. I created a group called “Temp Redirects” within the plugin. I want Editors to have access to this group only where they can add or delete redirections. Is this doable? I can’t see any specific Redirection permissions that allows me to do this.
@lopo Sorry for the late reply. That worked perfectly as expected. Thanks!
Thanks, will check this out!
Can someone from Yoast respond to this and let us know how to do this?
Forum: Developing with WordPress
In reply to: Uploading images to Media Library by URL via the API@alanfuller Yes, I’ve managed to resolve this using a custom endpoint.
@bcworkz All good now. I had been over-complicating the logic. Thanks for your tips.
@abretado1985 Simply registering the post type and taxonomy; and then re-saving the Permalinks did not automatically load the content on this URL:
https://www.example.com/books/arts/modern/sample-book/
. This needed additional rewrite rules (see below) and permalink rewrites.@bcworkz Yes, I’ve managed to fix the issue by using the
add_rewrite_rule()
function inside theinit
hook. I have a couple of questions in regards to the efficiency of the code.In my code, the rewrite rule includes nested
foreach()
statements that generates several of these rewrite rules to captureparent/child hierarchical taxonomy terms
like the following (there might be hundreds):https://www.example.com/books/arts/modern/sample-book/ https://www.example.com/books/arts/african/book-2/ https://www.example.com/books/arts/tattoo/needle-works/ https://www.example.com/books/comedy/classics/comedy-book-1/ https://www.example.com/books/crime/europe/crime-book-mafia/ https://www.example.com/books/crime/asia/crime-book-japan/ https://www.example.com/books/drama/classics/romeo-and-juliet/ https://www.example.com/books/drama/comedy/hello-world/ https://www.example.com/books/cars/classics/history-of-cars/
This is the code:
function book_category_rewrite_rule() { $parent_terms = get_terms(...); // Get parent terms foreach( $parent_terms as $parent_term ) { $child_terms = get_terms(....); // Get child terms foreach( $child_terms as $child_term ) { add_rewrite_rule( '^books/' . $parent_term->slug.'/'.$child_term->slug . '/([a-z0-9-]+)[/]?$', 'index.php?books=$matches[1]', 'top' ); } } } add_action( 'init', 'book_category_rewrite_rule' );
Does this always need to be fired from the
init
hook or can this be fired from other hooks? I was wondering if this could potentially slow down the site if this gets fired on every page load.Forum: Fixing WordPress
In reply to: ‘Category’ page is showing 404My expectation is that
/news/category/
by default should list all the categories or at least display something rather than returning “page not found”. It could just list the categories such as “development”, “design”, etc. Having a slug in a URL that returns “page not found” is just doesn’t seem right to me.Anyway, I’ve figured out a solution for this. I still don’t fully understand why this was not done by default.
Keeping with the same structure as the News in the example above, this is what I tested:
Under Dashboard > Pages:
I created a new Category page.
News (Posts Page) (/news/)
— Category (/news/category) – This tied up with page.php template (or page-category.php)Development (/development) – This tied up with page.php template
Under Dashboard > Categories:
Development (/news/category/development/) – This tied up with archive.php template
Under Dashboard > Posts:
Development (/news/development/) – This tied up with single.php template
This worked for me and had no conflict with anything. I also tried something similar with my CPTs. They are all working fine.
Forum: Plugins
In reply to: [Max Mega Menu] Pro version pre-sale questionsThanks Tom. I didn’t realise there was a demo menu on your site earlier.
I think that answers my questions.
Yes, it seems to have issues with PHP 8.
Looks like anything within the
count(...)
function needs to add arraycount((array)...)
I’ve already noticed this in
/admin/api_new.php
and/includes/functions.php
.Could you fix this?
@disablebloat Thanks! All good now.
Forum: Fixing WordPress
In reply to: Latest update, The editor has encountered an unexpected error.I had the same issue on my localhost site but when I logged into the website using Private mode, everything worked normally. So, must be a browser cache issue.
Thanks for your reply. Will wait for new plugin updates in regards to the WooCommerce Dashboard Setup Widget.
Re: the metaboxes, I don’t think I implemented other solutions to disable these. I also tried disabling few of my plugins but still couldn’t see the metaboxes on Shipping and Payments config pages. I’m happy that the metaboxes are not displaying but not sure what is hiding them by default.
@bcworkz Thanks. I get an idea now but like you mentioned, it has a bit of an issue when the content contains different HTML tags. So I’ve decided to leave it as a classic block for now. Then I can go back and manually convert to blocks in Gutenberg editor.
- This reply was modified 2 years, 7 months ago by wrip.
Forum: Plugins
In reply to: [Subscribe To Comments Reloaded] Issue with latest updateI also got the same error and the layout went berserk:
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2
($haystack) must be of type array, bool given in
/home/stu456/public_html/wp-content/plugins/
subscribe-to-comments-reloaded/wp_subscribe_reloaded.php:1540I tried deactivating-reactivating, tried Private browser mode to test and also saved the Options page as suggested above but it didn’t work. I’ve had to completely deactivate this plugin.
I am using:
Wordpress 5.9.3
Subscribe to Comments Reloaded 220502
PHP 8.0.18