Edit Post with a parameter in URL

I was thinking in a way to make the editors have a quick way to access the current post editor.

I know we can manage this by showing a Link and make some conditionals to show to some users and login in users, but it would be cool to have something like this.

I thought first in something like:

add_action('init', 'edit_post_please'); function edit_post_please() {     if (is_user_logged_in() && current_user_can( 'edit_posts' )) {         $  protocol = ((!empty($  _SERVER['HTTPS']) && $  _SERVER['HTTPS'] != 'off') || $  _SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";         $  url = $  protocol . $  _SERVER['HTTP_HOST'] . $  _SERVER['REQUEST_URI'];              $  id = url_to_postid($  url);           $  parts = explode("/", $  url);         $  editor = end($  parts);         $  editor_link = get_edit_post_link($  id);          if ($  editor == '?editor') {             wp_redirect($  editor_link);             exit;         }     } }  

I haven’t think about the security issues or anything else this code does’t seem to work at all, I mean it redirects well to Dashboard but not to post I would like to edit.

$ editor_link have the correct edit url, but seems that this could be a restriction of WP?

How to edit the default icon of Add Media button?

I am trying to replace the default Add Media icon in my WordPress site. I searched for the same on the web and got this:

How to replace default icon on "Add Media" button?

This seems to work for the OP, and ofcourse should’ve worked for others too. But, I am getting confused as the answer contains words like Child Theme and all. I could understand the first part of the answer, but I lost the track when the answer talked about this:

wp_enqueue_style('my-css', get_stylesheet_directory_uri().'/css/my-admin.css' 

From where did this part of the url came: '/css/my-admin.css. I searched in my database at the backend but couldn’t find this particular file anywhere. I know this might be a silly thing to ask, but this is it. Can someone help in this regard?

Google Optimize for A/B test: Trying to edit existing HTML but says it’s over the limit even when I test deleting some of it?

I am trying to set up an A/B test of a company’s website for my project. There are certain changes I’d like to make such as changing the ‘favourites’ products on the home page to one with the top selling products which I was trying to do by substituting the existing code simply with the top selling products instead (i.e. their jpg, their links, their names etc).

However I found that when making ANY change (by selecting the element and clicking ‘edit HTML’), even testing it by deleting one character from the original code, that it then pops up with this error notification saying that it’s over the word limit. Even when I put the character back for example, the error message is still there. And it will say weirdly that it is quite a lot of the word limit even though it’s basically the original code! I then have to click cancel every time.

Please see the attached photo for reference (where I deleted one character from the original code to demonstrate how any editing (even deletion of original working code) then comes up with the error that the html is over the limit).

View post on imgur.com

Thanks in advance!

wp-admin edit user url wont show up correct url

was expecting the edit url (shot below) would point me to something like:

website.co/wp-admin/user-edit.php?user_id=7&wp_http_referer=%2Fwp-admin%2Fusers.php <– expected url

Instead of

website.co/my-account/edit-account/&wp_http_referer=%2Fwp-admin%2Fusers.php <– ended up here

Also, I’ve read through some forums it might conflict with woocommerce or other plugins but tried to disabling all those plugins and still gave me the wrong link. Did I missing something? thanks

enter image description here

How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?

On the Edit Screen in the WP Admin there is a meta box for WP’s built-in Category taxonomy. This meta box is built using post_categories_meta_box() (/wp-admin/includes/meta-boxes.php).

This meta box uses wp_popular_terms_checklist( $ tax_name ) and wp_terms_checklist( $ tax_name ) to output the actual categories (with checkboxes) within the meta box.

wp_terms_checklist() (wp-admin/includes/template.php) uses the Walker_Category_Checklist (/wp-admin/includes/class-walker-category.checklist) to build the categories/checkboxes.

Walker_Category_Checklist inherits from Walker (wp-includes/class-wp-walker.php) just like a number of other WP walkers (Walker_Nav_Menu, Walker_Comment, Walker_Category, etc.).

When extending the Walker_Nav_Menu we can hook into the wp_edit_nav_menu_walker filter and return our custom walker. Is there a way to do this with Walker_Category_Checklist?

===

Update 1:

I see in wp_terms_checklist() there is:

apply_filters( 'wp_terms_checklist_args', $ args, $ post_id );

I’m thinking that I can hook into this filter, change the walker argument to a custom walker and that this may do the trick?

Automatically export backlinks from template edit with Notepad?

Good morning,

Im building some kind of automation through python and the thing that bugs me is that i have to navigate to Edit > Options > Automatically export… and select a new location where i want to export the verified backlinks.
Is there any way to set the automated export path using Edit with Notepad and some kind of property that handles the path?

EDIT:
More data… i know that i can export the template anytime i want but i really want it to be automatically exported so i can watch a folder looking for the report of backlinks (in case i want to do another tier or whatever)

Thank you so much!

Want to edit HTML code of website

Hello there,
I want to edit HTML code of my website and do some changes accordingly and thereafter want to save it. Does using any HTML editor plugin will help in case i uninstall it. Whether the changes will remain there or will be cleared. Any other option which does not involves using plugin and being non-technical I don't want to help of any web development company due to budget issue.

Thanks in advance!

Disable title block on edit screen for a custom post type

I have a custom post type with a custom block to collect required data and store it in post meta data or standard fields like title or slug, so I don’t want to display the Title block. I can’t disable title support in the CPT, because too much else depends on it.

The only successful attempt so far has been using CSS to target the id "post-title-0" of the for the title and can clearly enqueue a small CSS file depending on the post type, but I don’t want to depend on something set by WordPress that I can’t control; it feels that something in Javascript would be a better way to go if possible. I was wondering if WP provde any hooks for this but haven’t found any.

I’m a javascript novice, having started learning it in the last few weeks in order to write some custom blocks, so am not clear on the extent of what can be acheived with it. (I have 50 years experience of programming, just not in JS).

It would be OK to only hide the title until the post has been saved.

Has anyone any ideas?