Skip to content

Instantly share code, notes, and snippets.

View Ataurr's full-sized avatar
🎯
Focusing

AtaurR Ataurr

🎯
Focusing
View GitHub Profile
class ElementsKit_Extend_Onepage_Scroll{
public function __construct() {
// add_action( 'elementor/element/wp-post/document_settings/after_section_start', [ $this, 'register_controls' ], 10, 2 );
add_action( 'elementor/element/wp-post/document_settings/before_section_end', [ $this, 'register_controls' ], 10, 2 );
}
public function register_controls( Controls_Stack $element ) {
@Ataurr
Ataurr / Add option in exciting elementor widget
Last active March 28, 2020 14:24
Add option in exciting elementor widget
add_action( 'elementor/element/button/section_style/before_section_end', function( $element, $args ) {
$element->start_injection( [
'at' => 'after',
'of' => 'button_type',
] );
// add a control
$element->add_control(
'btn_style',
[
'label' => 'Button Styles',
@Ataurr
Ataurr / Activate license notice banner disable
Created December 15, 2019 06:31
Activate license notice banner disable
add_filter('elementskit/license/hide_banner', function(){
return true;
});
if (!function_exists('xs_convert_fa4_to_fa5')) {
/**
* Convert a Font Awesome 4 icon to Font Awesome 5
*
* @param $icon
*
* @return string
*/
function xs_convert_fa4_to_fa5($icon)
{
$(document).ready(function($) {
$('.mls').each(function(index, el) {
var this_val = $(this).text();
//'icon-play-button' => array('group' => 'finences-icons'),
$print_class = "'icon"+this_val+"' => array('group' => 'finences-icons'),";
console.log($print_class);
});
@Ataurr
Ataurr / Change slug in custom post type
Last active August 15, 2017 10:54
Change slug in custom post type
register_post_type( 'apb_room_type', apply_filters( 'awe_post_type_room_type', array(
'labels' => array(
'name' => _x( 'Room Type', 'Post Type General Name', 'awebooking' ),
'singular_name' => _x( 'AweBooking', 'Post Type Singular Name', 'awebooking' ),
'menu_name' => __( 'AweBooking', 'awebooking' ),
'all_items' => __( 'All Room Types', 'awebooking' ),
'view_item' => __( 'View Room Type', 'awebooking' ),
'add_new_item' => __( 'Add New Room Type', 'awebooking' ),
'add_new' => __( 'Add New Room Type', 'awebooking' ),
'edit_item' => __( 'Edit Room Type', 'awebooking' ),
I have found this issue occured from this line no 223
`$(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle().toggleClass(getIn);`
if remove this `.toggleClass(getIn)` this dropdown-menu class remain on there.
https://github.com/ThemeFuse/Unyson-Backups-Extension/issues/30#issuecomment-253008320
This possibility was already there #15
How to disable image sizes remove on Content Backup
Important! Use this code only while developing, to export a demo install with image sizes included. Do not include this code in theme in production, because all Content Backups created by user will be with image sizes.
Add the filter in {theme}/functions.php
@Ataurr
Ataurr / functions.php
Created December 7, 2016 11:59 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
function remove_subscribers() {
global $wpdb;
$args = array( 'role' => 'Subscriber' );
$subscribers = get_users( $args );
if ( !empty( $subscribers ) ) {
require_once( ABSPATH . 'wp-admin/includes/user.php' );
$i = 0;
foreach ( $subscribers as $subscriber ) {