GreatBlakes
Forum Replies Created
-
Forum: Plugins
In reply to: [Cloudflare] It would be rad if this plugin had a Dev mode toggle via toolbarAlright, I got it working. You can paste this code into your functions.php file and it will toggle Cloudflare Dev Mode from the WordPress Admin Bar. This isn’t the prettiest code, but it should do the trick. If we were to push into the plugin, I’d want to optimize it a bit.
This would be something that would be quite easy to implement into the Cloudflare plugin. In my personal implementation I added some status indicator icons for better UX during the AJAX call. If anyone on the plugin dev team would like a pull request for this, I’m happy to share my full code.
//Add a link to Cloudflare Options on the Admin Bar and indicate dev_mode add_action('admin_bar_menu', 'gearside_admin_bar_cloudflare', 100); function gearside_admin_bar_cloudflare($wp_admin_bar){ $cloudflare_dev_mode_status = get_dev_mode_status(get_option('cloudflare_api_key'), get_option('cloudflare_api_email'), get_option('cloudflare_zone_name')); $cloudflare_dev_mode_text = ''; $cloudflare_dev_mode_title = 'Enable Dev Mode'; $cloudflare_dev_mode_opposite = 'on'; if ( $cloudflare_dev_mode_status == 'on' ){ $cloudflare_dev_mode_text = '(Dev Mode)'; $cloudflare_dev_mode_title = 'Disable Dev Mode'; $cloudflare_dev_mode_opposite = 'off'; } $wp_admin_bar->add_node(array( 'id' => 'gearside-cloudflare', 'title' => 'Cloudflare ' . cloudflare_dev_mode_text, 'href' => get_admin_url() . 'options-general.php?page=cloudflare', 'meta' => array('target' => '_blank') )); $wp_admin_bar->add_node(array( 'parent' => 'gearside-cloudflare', 'id' => 'gearside-cloudflare-devmode', 'title' => $cloudflare_dev_mode_title, 'href' => get_admin_url() . 'options-general.php?page=cloudflare', 'meta' => array('onclick' => 'jQuery.ajax({type: "POST", url: bloginfo["admin_ajax"], data: {action: "gearside_cloudflare_dev_mode_toggle", data: "' . $cloudflare_dev_mode_opposite . '",}, success: function(response){window.location.reload();}, timeout: 60000}); return false;') )); } add_action('wp_ajax_gearside_cloudflare_dev_mode_toggle', 'gearside_cloudflare_dev_mode_toggle'); add_action('wp_ajax_gearside_cloudflare_dev_mode_toggle', 'gearside_cloudflare_dev_mode_toggle'); function gearside_cloudflare_dev_mode_toggle(){ if ( $_POST['data'] ){ $action = ( $_POST['data'] == 'off' )? 0 : 1; } set_dev_mode(get_option('cloudflare_api_key'), get_option('cloudflare_api_email'), get_option('cloudflare_zone_name'), $action); exit; }
Forum: Plugins
In reply to: [Cloudflare] It would be rad if this plugin had a Dev mode toggle via toolbarThis isn’t entirely what you’re asking, but it’s a start. This will give you a link to the Cloudflare settings page in the Admin Bar, and also indicate whether dev_mode is on or not.
I’ll probably keep messing with this function because I’m sure it’s possible to actually toggle dev mode using this method.
//Add a link to Cloudflare Options on the Admin Bar (and indicate dev mode) add_action('admin_bar_menu', 'gearside_admin_bar_cloudflare', 100); function gearside_admin_bar_cloudflare($wp_admin_bar){ if ( get_dev_mode_status(get_option('cloudflare_api_key'), get_option('cloudflare_api_email'), get_option('cloudflare_zone_name')) == 'on' ){ $cloudflare_dev_mode_text = '(Dev Mode)'; } $wp_admin_bar->add_node(array( 'id' => 'gearside-cloudflare', 'title' => 'Cloudflare ' . $cloudflare_dev_mode_text, 'href' => get_admin_url() . 'options-general.php?page=cloudflare' )); }
Forum: Plugins
In reply to: [Custom Post Type Maker] Icon Options+1 to this request. I love the interface, but the lack of Dashicon support is the only thing preventing me from switching over to this as my go-to plugin.
Edit: I just noticed in the features that it mentions media library uploads for icons- are the screenshots just not up-to-date? Also, does the icon form support Dashicons?
Forum: Plugins
In reply to: [Contact Form DB] CFDB Google Spreadsheet Live Data not linking (CFDB 2.8.3)Hey Michael, appreciate all the responses I’ve seen from you on various similar bugs. I’m having the exact issue described in the original post. Using the Export and Short Code Builder, I’ve tried both checking and unchecking the “Hide credentials” checkbox and pasting the code into Google Spreadsheets without success.
If I am logged into WordPress, the .csv is downloaded when visiting the provided URL, but if I am not logged in I get only a white page. In Google Spreadsheets, the cell returns #N/A with the error: “Error: Could not fetch url: https://…”
Do you happen to have any other tricks up your sleeve for troubleshooting this problem? Thanks.
Edit: This is interesting. I just tried it with a completely different WordPress site and it worked fine on the first try with the hidden credentials. Maybe it could be something on the server-side? Both sites have the same version of CForm7 and CForm DB.
Forum: Plugins
In reply to: [Search Everything] Prevent 404s when "?s" is in the URLThanks for the response. I initially programmed it using another parameter, but I prefer “s” because it is used for keywords- since in this case I’m using the search terms I like it because it pre-propagates the search field (so I don’t need to duplicate functionality).
If I absolutely had to, I could change the parameter, but I’d like to avoid any code bloat if possible.
Forum: Plugins
In reply to: [Ultimate Facebook Comments Email Notify] FB is not definedI’m having the same problem. What is happening is you are loading the Facebook SDK asynchronously (which is the proper way), but this plugin is calling it before it initializes.
The quick and dirty fix would be to go into the plugin and edit ultimate-facebook-comments-email-notify.php and on line 81 (inside that <script> opening, add the code:
setTimeout(function(){
and then right before the </script> around line 118 add the code:
}, 3000);
Basically this delays the load of this FB call by 3 seconds which is plenty of time for the asynch FB to init. It is not a good way to fix it, but will stop the JS error.
Forum: Reviews
In reply to: [Ultimate TinyMCE] Usefull, but please un-style on the plugin page!Ah, did not know that. I’ll look into it. Thanks again.