Izaac Johansson
Forum Replies Created
-
Trying to add validation in my plugin, but it doesn’t work.
I have a field for a verification code, that shall be verified against another server (api stuff) and it seems that the validation doesn’t run at all. tried die’ing inside my validate function to no avail.
the code should be like this, right:
add_action( ‘um_submit_form_errors_hook_’, ‘my_validation’ )
function my_validation($args) {
// code
}And what shall I put in the form editors custom validation field? All docs on this is EXTREMELY vague.
Forum: Hacks
In reply to: Impliment plugins directly through codeYou could add
<?php echo do_shortcode('[instagram-feed]'); ?>
in the template file. But remember that everyone that uses the theme might not want that functionality and/or have that plugin installed.If you’re building this for others to use, I suggest using TGMPA and implementing a check to see if the plugin is installed and activated.
Here’s the code I use myself to check if a plugin is installed.
function is_plugin_installed($plugin_dir) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } if(!startsWith($plugin_dir, DIRECTORY_SEPARATOR)) { $plugin_dir = DIRECTORY_SEPARATOR . $plugin_dir; } $plugins = get_plugins($plugin_dir); if ($plugins) return true; return false; } function startsWith($haystack, $needle) { return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false; }
To check if it is active you could get the ‘active_plugins’ option array and see if it’s listed.
Hope this helps.
Forum: Fixing WordPress
In reply to: XML RPC SSL IssuesResolved by changing the Site and Home URL. They were https:// instead of https://
Solution was found here: https://www.ads-software.com/support/topic/this-site-cannot-be-accessed-disconnect-site-1?replies=10
Might be useful if Another user stumbles across this.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Admin Area Table content boxesThanks.
I could not find the handle you mentioned, but that extension seems to fit my needs perfectly ??
Regards
Izaac