charafweb
Forum Replies Created
-
Thank you for your reply.
I will investigate your idea and see if I can do something.Thanks again
Forum: Plugins
In reply to: [Revisionize] How to get ID of the revisionI do know that your plugin was not designed to be used like that π I will look again in the core code, as you said, to try to understand what happening there π If you come back with any idea please share it with me.
Thanks a tonForum: Plugins
In reply to: [Revisionize] How to get ID of the revisionHi @jamiechong
Thanks for your reply.
I’m using this action from “WP All Import” plugin to check if the post will be updated during the import process. I’m trying to schedule imported (only updated) posts.function my_is_post_to_update( $continue_import, $post_id, $data, $import_id ) { ... $post = get_post($post_id); Revisionize\create_revision($post, true); // create a revision of the original post // Getting Revision ID $new_id= how_to_get_id_of_the_revision(); // << THIS $post = get_post($new_id); // Geting post object $post->post_date_gmt = $postdate_gmt; // defined earlier $post->post_date = $postdate; // defined earlier wp_update_post( $post ); // Update the revision with scheduled dates ... } add_filter( 'wp_all_import_is_post_to_update', 'my_is_post_to_update', 10, 4 );Thank you
- This reply was modified 7 years, 3 months ago by charafweb.
Maybe something like this:
foreach ($data as $key => $value) { update_post_meta( $new_id, $key, $value ); // $new_id : ID of the revision }But, I can’t get the list of custom fields and taxonomies with their values!
Any help please?
Hi,
I forgot to mention that the original (and the revision) post has some custom fields and taxonomies.
Thank youForum: Developing with WordPress
In reply to: How to get the ID of a trashed post from functions.phpπ I found it at the same time as you π
Thanks @bcworkzForum: Developing with WordPress
In reply to: How to get the ID of a trashed post from functions.phpThe query:
$wpdb->get_var( " SELECT ID FROM $wpdb->posts WHERE post_name = '$get_slug' " );won’t return anything if the post is trashed because slug of trashed post has a suffix “__trashed” that I did not included in the provided slug.
So, we have to change the slug as bellow:
$get_slug = trim($_SERVER['REQUEST_URI'], '/') . '__trashed';Forum: Developing with WordPress
In reply to: How to get the ID of a trashed post from functions.phpHi @bcworkz
I think this is what you mean:add_action('template_redirect', 'trash_redirect'); function trash_redirect(){ $get_slug = trim($_SERVER['REQUEST_URI'], '/'); if (is_404()){ global $wpdb; $page_id = $wpdb->get_var( " SELECT ID FROM $wpdb->posts WHERE post_name = '$get_slug' " ); $post_status = get_post_status( $page_id ); if( $post_status == 'trash' ){ wp_redirect(home_url(), 301); die(); } } }But it’s not working and I don’t know why. Any Idea?
ThanksForum: Developing with WordPress
In reply to: How to get the ID of a trashed post from functions.phpHi @bcworkz ,
The following code (found on github) that make me think that we can access trashed posts IDs when is_404 :add_action('template_redirect', 'trash_redirect'); function trash_redirect(){ if (is_404()){ global $wp_query, $wpdb; $page_id = $wpdb->get_var( $wp_query->request ); $post_status = get_post_status( $page_id ); if($post_status == 'trash'){ wp_redirect(home_url(), 301); die(); } } }But even this code is not working.
And I’m still trying and trying πForum: Themes and Templates
In reply to: [GeneratePress] [Request] Taxonomy description after postsOK. Thank you very much. It was a honour to chat with you.
Forum: Themes and Templates
In reply to: [GeneratePress] [Request] Taxonomy description after postsHi,
I want the name of the category to stay on top, and a descriptive SEO optimized h1 title at the bottom (after the posts) followed by the description paragraphs.
ThanksForum: Themes and Templates
In reply to: [GeneratePress] [Request] Taxonomy description after postsThanks a lot @edge22 for your reply.
I found a “solution” on your website, but it needs to hide the default taxonomy-description div using CSS, and I’m not sure if Google will like hiding this text and repeat it at the bottom.I achieved what I want by removing the lines that outputted the description from generatepress/inc/structure/archives.php, and I used the function you mentioned to output the description after posts. However, this way if there is an update I have to re-edit that file again.
It would be nice if there is a setting to make this without editing files. I have a long description with headings for SEO purpose, and if I left it on the top, the user
may understand that it is the main content of that category page, it will make confusion.By the way, if you are going to create that option, please make the page-title an h2, and let the user create a custom h1 in the description (for SEO purpose), because an H1 that contain just a word (the name of the category) itβs not sufficient.
Thanks a ton
The issue is related to cloudflare! solved! thanks
Thank you @cybr for your reply.
I did change domain to new one in /wp-admin/options-general.php.
I’m sorry to say that I’m using 16 plugins and the only one that has this issue is The SEO framework! Strange!
I’ll try and see what can I do later when I have some time, as this does not affect the plugin functionalities.
Thanks again π
HI,
Solved by increasing the value of “max_input_vars” to 10000
=> php.ini file
Open the php.ini file and insert/edit this line:
max_input_vars = 10000
Solution is from here: https://wpml.org/forums/topic/theme-and-plugins-localization-admin-ajax-php-500-internal-server-error/#post-1353754
Thanks for everyone
- This reply was modified 7 years, 10 months ago by charafweb. Reason: tipo