How to submit the custom form data in database in WordPress without plugin?

Finally, I got my solution, I added below code in function.php and using shortcode I am getting my form on webpage function st_contact_form(){ ob_start(); ?> <div class=”contact_form-wrapper popup-contact-form”> <form action=”” method=”post” name=”contact_form” id=”contact_form” autocomplete=”off”> <div class=”row”> <div class=”col-xl-6 col-lg-6 col-md-6 col-sm-12 col-xs-12 “> <div class=”form-group”> <input type=”text” name=”name” placeholder=”Name” class=”form-control” required> </div> </div> <div class=”col-xl-6 … Read more

If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]

I think it depends on the case. If the taxonomy is essential part of the theme, then functions.php might be appropriate place for registering it. If the taxonomy doesn’t care which theme is in use on the site, then a custom plugin might be better place for it. Please note that asking about best practices … Read more

Check if MemberPress exists before add_action call

Since I do not have access to the plugin to confirm I’ll use generic info and updated my answer since I was using the demo they had in their docs. This works in the functions file or on the frontend. // check for plugin using plugin name if(in_array(‘plugin-directory/plugin-file.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))){ //whatever you need goes here. … Read more

How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?

I didn’t call the class yet, this code is now working class Scheduler { public $setup; public static $instance; public function __construct() { self::$instance =& $this; add_action(‘scheduler’, [$this, ‘etf_scheduler_func’]); } public function etf_scheduler_func() { $this->setup = new Setup(); $this->setup->set_table(); } public static function &get_instance() { if ( ! isset( self::$instance ) ) self::$instance = new … Read more