jas
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Twitter Auto Publish] Incorrect Post permalink used in TweetI have added below code to make same thing to shorten length of url. Just writing to make sure if there is any filter/hook available.
But still plugin do not use the final permalink of post./* * Limit title length in permalink / slugs */ add_action( 'save_post', 'wpse51363_save_post', 25, 2 ); function wpse51363_save_post($post_id, $post){ //if it is just a revision don't worry about it if (wp_is_post_revision($post_id)) return; //if the post is an auto-draft we don't want to do anything either if($post->post_status != 'auto-draft' ){ // unhook this function so it doesn't loop infinitely remove_action('save_post', 'wpse51363_save_post', 25 ); //this is where it happens -- update the post and change the post_name/slug to the post_title $string = $_POST['textarea_title_field']; $words = explode(" ", $string); $firstTenWords = array_slice($words, 0, 10); $result = implode("-", $firstTenWords); $result = preg_replace('/[-–]+/', '-', $result); wp_update_post(array('ID' => $post_id, 'post_name' => str_replace(' ', '-', $result))); //re-hook this function add_action('save_post', 'wpse51363_save_post', 25 ); } }
- This reply was modified 1 year, 4 months ago by jas.
Forum: Plugins
In reply to: [XML Sitemap Generator for Google] ‘discard_content’ does not existThis gives error in console :
Uncaught TypeError: Cannot read properties of null (reading ‘classList’)
at post.php?post=3002&action=edit&classic-editor:525:47Hi!
Thanks for your reply. I have now found the filter and able to work it as required.
add_filter('woocommerce_is_checkout','override_status_on_post_page');
function override_status_on_post_page($is_checkout){
// modified is_checkout variable according to my requirements
return $is_checkout;
}
Forum: Plugins
In reply to: [Wise Chat] How to open a ChannelThanks for reply ! It’s working fine after removing plugin completely and reinstalling.
I have provided details here : https://www.ads-software.com/support/topic/plugin-not-working-error-400-ajax/#post-16035141
Forum: Plugins
In reply to: [Wise Chat] Plugin not working error 400 ajaxThanks! for your reply but it was displaying below message in chat settings -> channels :
Channels
No channels created yet
Notice: users’ counter accuracy: 120 s.But now after fresh install its working fine. I have not set any password but it started working fine and now it shows proper channel under settings. Not sure what I was doing wrong but its working fine ??
Forum: Plugins
In reply to: [Wise Chat] Plugin not working error 400 ajaxDebug mode error log. Select and copy the text below.
2022-09-20 07:09:33 [error] Channel names cannot be empty
2022-09-20 07:09:37 [error] Channel names cannot be empty
2022-09-20 07:09:41 [error] Channel names cannot be empty
2022-09-20 07:09:46 [error] Channel names cannot be empty
2022-09-20 07:09:50 [error] Channel names cannot be empty
2022-09-20 07:09:54 [error] Channel names cannot be empty
2022-09-20 07:09:57 [error] Channel names cannot be empty`Forum: Plugins
In reply to: [Wise Chat] How to open a ChannelBelow is error in console in debug mode :
Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
Forum: Plugins
In reply to: [Wise Chat] How to open a ChannelSimilar issue for us, error is “No channels created yet”.
Please suggest I have disabled cache plugin and cleared all caches including browsers cache.
For example below short-cods are used for testing :
[wise-chat channel=”testroomch”]
[wise-chat channel=”My Room”]
Thanks!
Forum: Plugins
In reply to: [Meta Box] How to disable validations when saving draft ?I have solved it in different way using this action
add_action('save_post', 'my_custom_save_post');
- This reply was modified 2 years, 10 months ago by jas.
Forum: Plugins
In reply to: [Meta Box] How to disable validations when saving draft ?For example using hook such as :
add_filter('wp_insert_post_data','callback_function');
or using
save_post
hook etc- This reply was modified 2 years, 10 months ago by jas.
Forum: Plugins
In reply to: [Meta Box] How to disable validations when saving draft ?Thanks for your comments !
Seems like possible in acf wordpress plugin, any plans to implement this ?
Looks like validations are handled on client side https://docs.metabox.io/validation/#validation-with-input-attributes, I think applying conditions will be possible if we can completely disable metabox validations at client side and apply our custom validations on server side on post from submit. Is that possible to add validations on fields created with metabox with PHP code in custom plugin etc
I have to add code in function named
public static function template_redirect()
in file wp-content/plugins/content-control/classes/Site/Restrictions.phpif(isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] == '/oauth/authorize'){ return; } if(isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] == '/oauth/token'){ return; }
- This reply was modified 2 years, 12 months ago by jas.
@mangojuice its working fine for us after update. seems like warning no more relevant https://developer.woocommerce.com/2021/01/25/woocommerce-4-9-2-fix-release/
@themehigh any updates on this, seems like now it started saying that (Compatibility with WordPress 5.6.2: 100% (according to its author)) but still shows same pop-up warning.
Is it safe to update now ?
Forum: Plugins
In reply to: [WooCommerce] Deprecated: WC_Cart->tax_display_cartThe WC_Cart->tax_display_cart argument is deprecated since version 4.4. Use WC_Cart->get_tax_price_display_mode() instead.
Same for us !