Skip to content

Instantly share code, notes, and snippets.

View nayemDevs's full-sized avatar

Md. Nazmul Hassan nayemDevs

View GitHub Profile
@nayemDevs
nayemDevs / wpuf-woo-price.php
Created January 6, 2016 13:23 — forked from tareq1988/wpuf-woo-price.php
WooCommerce price adjustment for WPUF
<?php
/**
* WooCommerce price adjustment for WPUF
*
* @param int $post_id
*
* @return void
*/
function wpufe_update_post_price( $post_id ) {
function remove_wc_password_meter() {
wp_dequeue_script( 'wc-password-strength-meter' );
}
add_action( 'wp_print_scripts', 'remove_wc_password_meter', 100 );
function wpufe_update_post_geo1( $post_id ) {
function gmw_update_post_type_post_location( $post_id ) {
// Return if it's a post revision
if ( false !== wp_is_post_revision( $post_id ) )
return;
// check autosave //
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
@nayemDevs
nayemDevs / GeoDirectory Conflict fix
Created January 18, 2017 04:15
Conflict between Dokan and GeoDirectory plugin
function _mygd_dequeue_script() {
if(!function_exists('geodir_plugin_url')){return;}
wp_deregister_script( 'chosen' );
wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
wp_dequeue_style( 'dokan-chosen-style' );
}
add_action( 'wp_print_scripts', '_mygd_dequeue_script', 100 );
@nayemDevs
nayemDevs / set default category for a form
Created June 6, 2016 05:44
Now, after adding these code you have to add a hidden field into your form. You have to insert the meta key name "wpuf_hidden_cat" and the value will be your category ID.
add_action( 'wpuf_add_post_after_insert', function( $post_id ) {
wp_set_post_terms( $post_id, get_post_meta( $post_id, 'wpuf_hidden_cat', true ), 'your taxonomies name' );
});
@nayemDevs
nayemDevs / dashboard color change
Created November 22, 2016 05:28
change dashboard hover, button color
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:hover{
background: #6abb46;
}
input[type="submit"].dokan-btn-theme, a.dokan-btn-theme, .dokan-btn-theme,
input[type="submit"].dokan-btn-theme:hover,
a.dokan-btn-theme:hover,
@nayemDevs
nayemDevs / Extra field on Registration Form
Created October 19, 2016 17:34
Extra Field For WordPress Registration
/* Showing the extra field on the registration form */
add_action('register_form', 'new_register_field');
function new_register_field() {
?>
<p>
<label for="first_name"><?php _e('First Name') ?><br />
<input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr($_POST['first_name']); ?>" size="25" tabindex="20" />
</label>
</p>
/*MIME TYPE*/
function wpufe_custom_upload_extensions( $extensions ) {
$extensions['custom'] = array(
'label' => __( 'Custom Extensions', 'wpuf' ),
'ext' => 'eps,ai',
);
return $extensions;
}
/* global shipping for each seller into the seller profile */
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) {
$country_obj = new WC_Countries();
$countries = $country_obj->countries;
$states = $country_obj->states;
@nayemDevs
nayemDevs / Dashboard menu
Last active January 31, 2019 20:18
Add a new seller dashboard menu
<?php
add_filter( 'dokan_query_var_filter', 'dokan_load_document_menu' );
function dokan_load_document_menu( $query_vars ) {
$query_vars['document'] = 'document';
return $query_vars;
}
add_filter( 'dokan_get_dashboard_nav', 'dokan_add_document_menu' );
function dokan_add_document_menu( $urls ) {