allm
Forum Replies Created
-
Forum: Hacks
In reply to: manage_posts_columns filter fires for CPT’s@bcworkz
Thanks a lot! This seems to work. I thought I tried that first yesterday, but apparently not. Just to be thorough I also tried variations AND looked at the source to no avail.This helped me back on track. Thanks again. Have a great day!
Forum: Hacks
In reply to: manage_posts_columns filter fires for CPT’sSorry,
add_action( "manage_post_custom_column" , 'function2', 99, 2 );
will not work.
Does anybody now what action will target only regular posts and NOT CPTs?
Forum: Hacks
In reply to: manage_posts_columns filter fires for CPT’sI’ll answer it myself:
After a lot of searching and trying this seems to work:
add_filter( “manage_edit-post_columns” , ‘function1’ );
add_action( “manage_post_custom_column” , ‘function2’, 99, 2 );Note that the action name is NOT manage_posts_custom_column (note the s) which will target COT’s as well.
At least this is what now works for me.
I’ll leave this thread open for a short while, just in case someone wants to shine a light on this as well…
Funny, when Falcon was introduced there was a debate about whether it should be part of the WordFence plugin. Some users wanted it to be a seperate plugin, and not part of WordFence.
Maybe that is what is happening now. I would be all for that. It really is a function that should be seperate.
Let’s see what happens. I guess more news is on its way…
Forum: Fixing WordPress
In reply to: do_shortcode in template not workingTo my surprise the [video] shortcode does work. Width and height seem to not take percentages, so I have set them to fixed values. And again surprisingly, the result is responsive, which is what I want.
The documentation in the codex has no info about the [video] shortcode taking a Vimeo of Youtube URL as input, so one has to wonder about what will happen in the future with this shortcode.
I’m still wondering why the [embed] shortcode doesn’t work. It is just one of the Built-In Shortcodes, like [video].
Does someone know why putting the bare URL does not work in templates and it does work in post and pages?
Anyway: thanks for pointing me in the right direction. Let’s say that it works, and that is more than the status from earlier… ??
I’ll set this to resolved.
- This reply was modified 8 years, 5 months ago by allm.
Forum: Fixing WordPress
In reply to: do_shortcode in template not workingThe [video] shortcode is for embedding files. It does not take an a URL as input. I will try it anyway and report back.
I was wondering why I needed to use a short code in the first place. Placing a Vimeo or Youtube URL in a post or page results in embedding the movie. Placing / generating it in a template does nothing.
Any other ideas?
Forum: Fixing WordPress
In reply to: changing permalink for a custom postYour example gave me the basis to find out what was going on. Your example gives the “edit permalink button” below the title, as one would expect.
I noticed you had ‘public’ set to true. That argument is merely a way of defining 4 other arguments in 1. If you set that to false (which is what I wanted) and then set ‘show_ui’ to true to get the user interface back you get the complete user interface except the “edit permalink button” below the title.
Seems like a bug to me, so I’ll report it and see what happens…
Forum: Fixing WordPress
In reply to: changing permalink for a custom postThanks for taking the time to help out. I do trust wordpress, but that didn’t help. I will check the code you provided and see if that results in an “edit permalink” button below the title (like posts and pages) for that custom post.
If that works, I will see where the differences are with my arguments. If I have it pinpointed I’ll report back here.
Thanks so far!
Forum: Fixing WordPress
In reply to: changing permalink for a custom postI just noticed that I am able to change the slug for a custom post, resulting in a change of the permalink. So I can change it when needed.
Just thought that there would be an edit permalink button for custom posts, just below the title, as pages and posts do. And it is not automatic as it is with pages and posts..
So I am still curious to know if this can be achieved for custom posts. Just an edit permalink button below the title, and an automatic update of the permalink after editing the title. Just like pages and posts.
Forum: Fixing WordPress
In reply to: changing permalink for a custom postThis is the snippet:
'supports' => array( 'title', 'editor', 'revisions', 'thumbnail', 'comments' ), 'rewrite' => array( 'slug' => '/d', 'with_front' => false, 'feeds' => false, 'pages' => false ),
Forum: Fixing WordPress
In reply to: changing permalink for a custom postYes, I do have the rewrite clause in register_post_type(). I have checked some more and see that other custom posts I have created in the past have the same problem.
There is no edit button for the permalink just below the title when editing the specific custom post (as posts and pages have). And also the permalink is not changed if the title is changed. Pages and posts do have a different permalink after changing the title.
Is this a bug, or on purpose? Or is there a setting in register_post_type() that enables/disables this?
Forum: Hacks
In reply to: rewrite rules for hierarchical custom postsThanks for looking into this!
While registering the custom post I use this as one of the arguments:
'rewrite' => array( 'slug' => '/abc', 'with_front' => false, 'feeds' => false, 'pages'=> false ),
This will result in permalinks like:
https://www.example.com/abc/postslug
https://www.example.com/abc/postslug/childslugand so on.
The default rewrite rules that are being generated for handling this do not match the permalinks that WordPress itself generates. That sounds strange to me.
I’ll have a look at writing my own rewrite rules (new territory), but one would expect that WordPress generates the rewrite rules that match the permalinks that it generates.
Thanks for the piece of code you provided. I’ll have a go at that. I’ll also have a look at “ep_mask” that is one of the arguments when registering the custom post…
Any more ideas are welcome. If I get this fixed I’ll report it here. And if not I will go with a flat custom post structure and fix it another way…
Forum: Hacks
In reply to: Search redirect to custom pageI am not sure how much you know so you can add to the following code, but I’ll give it anyway:
function allm_redirect_search() { if ( is_search() && isset($_GET['s']) ) { // add some code to decide where you want to go, based on $_GET['s'] // Go to other page: wp_redirect( LINK-TO-PAGE ); exit(); } } add_action( 'template_redirect', 'allm_redirect_search' );
Hope this gets you in the right direction.
Same here. Maybe this is because of:
https://www.ads-software.com/support/topic/wordfence-619-crashes-wp-after-update-to-453Waiting for a new version…
Forum: Hacks
In reply to: Append Custom Query String To Standard WP Search QueryYour site seems to have problems. Check it here:
https://sitecheck.sucuri.net/results/blog.anca.tv/