Skip to content

Instantly share code, notes, and snippets.

View encoderit-arman's full-sized avatar

Arman H encoderit-arman

View GitHub Profile
If you’ve made some commits in the detached head then if you need those commits on your master. For that, all you need is to create a new branch and merge it to master and then delete the branch. For that you can do:
git branch temp
Now checkout to master
git checkout master
Merge the branch
@encoderit-arman
encoderit-arman / Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'pthfc_add_form_function' not found or invalid function name in C:\laragon\www\wordpress\wp-includes\class-wp-hook.php on line 287
Created April 9, 2020 05:15
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'pthfc_add_form_function' not found or invalid function name in C:\laragon\www\wordpress\wp-includes\class-wp-hook.php on line 287
add_menu_page( 'PDF TO WP FORM CONVERTER', 'PDF TO WP FORM CONVERTER', 'manage_options', 'pthfc-converter', 'pthfc_main_description_fucntion' );
add_submenu_page("pthfc-converter", "Add Form", "Add Form", 'manage_options', "ptwc-add-form", "pthfc_add_form_function");
Change To :
add_menu_page( $this->plugin_name, 'PDF TO WP FORM CONVERTER', 'manage_options', 'pthfc-converter', array($this,'pthfc_main_description_fucntion') );
add_submenu_page("pthfc-converter", "Add Form", "Add Form", 'manage_options', "ptwc-add-form", array($this,'pthfc_add_form_function'));
You can follow this blog:
$upload = wp_upload_dir();
$upload_dir = $upload['basedir'];
$upload_dir = $upload_dir . '/mypluginfiles';
if (! is_dir($upload_dir)) {
mkdir( $upload_dir, 0700 );
}
<ul>
<?php
$get_parent_cats = array(
'parent' => '0' //get top level categories only
);
$all_categories = get_categories( $get_parent_cats );//get parent categories
foreach( $all_categories as $single_category ){
//for each category, get the ID
Why when I submit a form in wordpress it loads a 404 page though URL is correct
if You use any email field like below
<input type="email" name="email">
Don't use like this change the name like name="test-email"
Then you are able to submit form
This is what worked for me Hopefully no one else will burn oil to figure this out like i did.
Here is my sendmail.ini
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=25
error_logfile=error.log
debug_logfile=debug.log
add_filter( 'woocommerce_product_add_to_cart_text', 'custom_loop_add_to_cart_button', 20, 2 );
function custom_loop_add_to_cart_button( $button_text, $product ) {
// HERE define your specific product IDs in this array
$specific_ids = array(37, 40, 53);
if( in_array($product->get_id(), $specific_ids) ) {
$button_text = __("add to cart", "woocommerce");
} else {
$button_text = __('+', 'woocommerce');
}
<img
src="<?php the_sub_field('slider_image_mobile'); ?>"
srcset="
<?php the_sub_field('slider_image'); ?> 1280w,
<?php the_sub_field('slider_image_tab'); ?> 900w,
<?php the_sub_field('slider_image_mobile'); ?> 600w,
<?php the_sub_field('slider_image_mobile'); ?> 360w, "
sizes="100%"
alt="slider"
/>
https://colorlib.com/wp/responsive-html-email-templates/
https://colorlib.com/etc/email-template/11/index.html
https://github.com/leemunroe/responsive-html-email-template