Get post ancestors in the Block Editor

August 20, 2022 Update: For completeness, I added a JavaScript/Gutenberg solution which does what the findParent() function in question tries to do, i.e. find the top ancestor. You can find the code below the “Original Answer” section. Original Answer The block editor doesn’t (currently) have a function equivalent to get_post_ancestors(), and yes you could create …

Read more

Is it possible to know which menus are owned by a plugin?

Technically speaking, you can use PHP’s debug_backtrace() function along with appropriate WordPress hooks like wp_nav_menu, add_menu_page etc. to get the file names and function names these WordPress API functions/hooks are called from. From there, you should be able to determine which plugin is creating or modifying what menu. However, please note that functions like debug_backtrace() …

Read more

How to force static assets with HTTP sources to load over HTTPS?

If assets are enqueued properly they are using the exact URL they are enqueued with. If the protocol in URL is hardcoded that causes mismatch issues you are seeing. For proper protocol support enqueued URLs need to be either: created with protocol-aware API function from WP API (most if not all functions that produce URLs …

Read more

How to enable truly anonymous posting in bbPress forums? [closed]

When we post an empty anonymous reply, we get the following errors: The part of BBPress that’s responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter anonymous data $anonymous_data = bbp_filter_anonymous_post_data(); …

Read more

Multiple WordPress sites eat up a lot of RAM

It’s hard to answer this given that each site is most likely different and each server is also configured differently. If these sites are individual WordPress installs then 1GB /30 sites is normal, an absolute bare minimum per site would be 32MB for apc.shm_size, this equals 960MB with no overhead. 32MB is in my opinion …

Read more

Content expands beyond its column container [closed]

As far as I can tell, the most right column is being nested within the middle reviews column. I imagine that somewhere in the code (template, sidebar, or widget) there is a conditional statement causing your middle column to not get closed off before the right column starts. To illustrate what is happening, this is …

Read more

How to hide sub categories in sidebar [closed]

You didn’t give us markup so I can’t know if this is correct but .sidebar .children { display:none;} EDIT: I think you’re looking to hide your .commentlist .children correct? Line 1460-1463 of your file are the .children selector. try making each of them ol.commentlist li ul.children li.depth-2 { margin:0 0 3px; display:none} ol.commentlist li ul.children …

Read more