Good evening everyone. I have a question:
I'm inserting datalayers for GTM via wpcode. The problem is that the checkout datalayer also includes the checkout/order-received endpoint. Is there a way to exclude that endpoint?
I tried with the plugin to exclude with its interface but it doesn't work, then I tried through php like this but nothing:
If (is_wc_endpoint_url (‘checkout’)) { //showdatalayer }else { //hidedatalayer }
There is another way for solve this issue?
Related
Hi I created a chatbot and using node red to add this chatbot different features. I connected this chatbot to slack using webhooks. I am trying to do the same thing on wordpress, so far I read about how to do that but i dont know how to create the chatbot box on worpress and use the service, below you can see the code on PHP for my wordpres. if some one help me with this ill be fully greatful.
// make a function that loads before anything on wordpress loads
add_action('init','webhook_super_star');
// in the function look for a unique server related URI
// I personally like to check against a GET variable
function webhook_super_star() {
if( $_SERVER['REQUEST_URI'] == '/webhook' ||
$_SERVER['REQUEST_URI'] == '/webhook/') {
//Do some cool stuff
}
}
There is already a Wordpress plugin available that helps you to integrate Watson Assistant (previously Conversation) into your wordpress site - https://wordpress.org/plugins/conversation-watson/
Here’s an article to help you with step-by-step instructions - https://medium.com/ibm-watson/add-watson-assistant-to-your-wordpress-site-6f30d537b9e5
I've created my own wordpress theme and installed WP-Postratings plugin, but it doesn't work. I add only
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
It show rating image, but i can't rate anything.
Should I add something to the functions, maybe the reason is ajax, should I add some function?
I'm using the same plugin on my theme
Rating Buttons
if(function_exists('the_ratings')) { the_ratings(); }
Rating Avarage
if(function_exists('the_ratings')) { echo ''.expand_ratings_template('<span class="rating-images">%RATINGS_IMAGES%</span>', get_the_ID()); }
If it doesnt work you may have any javascript conflict , try to disable all plugins and try it again.You must be sure that admin-ajax.php is not blocked by server or anything else.
You should add something to the functions. That code is enough.
It usually happened because the plugin is crashed with another plugin. Disable another plugins one by one until you can rate. Then change the plugin that make the issue with the similar one.
I build a plugin that base on plugin https://wordpress.org/plugins/amp/ and I want to check state when the user on AMP post or page.
What is the function that allows us to check AMP endpoint in WordPress?
You can use the is_amp_endpoint() function to check if the currently loaded page/post is an AMP one.
I strongly suggest to use the is_amp_endpoint() function and wrap it within an existing condition, such as the following:
if (function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()) {
// do stuff
}
That way your Wordpress web site won't crash if/when the WP-AMP plugin gets disabled (or changes its behaviour / method signature).
For additional info and alternative ways to do that, check out this blog post that I wrote on this topic.
I need my plugin to run a function immediately after the plugin has been installed. The reason I need to run the function after and not during the installation is because none of the hooks work until "after" the plugin is activated and I need to do some additional install synching with a thirdparty server and I need those hooks.
So far I've found nothing that does what I want. The crons functions, from what I can tell and from what the codex says, only fire after someone visits the site. This is a "no no". The plugin cannot wait some "random" period of time. It might even be a serious security risk.
Thirlan, I have the same problem. I haven't been able to come up with a great solution, so what I'm doing is on plugin activate I'm setting a update_option and then once the settings page is visited I'm checking for the get_option to check for my one-time setting and if it's there, I fire off the function and delete_option. Now this won't exactly work for you, but... you might be able to figure out how to apply this filter:
http://adambrown.info/p/wp_hooks/hook/install_plugin_complete_actions?version=3.0&file=wp-admin/includes/class-wp-upgrader.php
or you might be able to sort of use my method. Try this:
register_activation_hook(__FILE__, 'initialize_my_function');
function initialize_my_function() {
add_option('run_my_initialization',"1");
}
add_action('admin_init', 'launch_activation_script');
function launch_activation_script() {
if (get_option('run_my_initialization') == "1") {
//Do Your Init Stuff Here
delete_option('run_my_initialization');
}
}
Can you use register_activation_hook?
I would like to create a plugin that uses the contact form 7 hook, wpcf7_admin_after_mail. I want to use the plugin to interface with a CRM system. What I have thus far is the following:
//plugin header here
function add_to_CRM( $cf7 )
{
if (isset($cf7->posted_data["your-message"]))
{
full_contact($cf7);
} else {
quick_quote($cf7);
}
return $cf7;
}
add_action('wpcf7_admin_after_mail', 'add_to_CRM');
//other functions here
I can't seem to get this working. I can't even get the hook to work and do something like mail me. Anybody have any idea what I'm doing wrong here. Since I have limited Wordpress experience I might me missing the boat completely with what I'm trying to do here. I've Googled for answers to no end.
EDIT: I ended up adding this to the theme's functions.php file and it works perfectly. Thing is, I want to get it working as a plugin. Any help will be appreciated.
Try delaying the add_action() call, something like;
add_action('init', create_function('',
'add_action("wpcf7_admin_after_mail", "add_to_CRM");'));
This actually registers your CF7 hook once WordPress is ready (which is nearer the time functions.php gets loaded in).