Skip to content

Instantly share code, notes, and snippets.

View Sharifur's full-sized avatar
🎯
Focusing

Sharifur Rahman Sharifur

🎯
Focusing
View GitHub Profile
DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock
put this in .evn file
@Sharifur
Sharifur / wp_remote_post_example.php
Created June 2, 2020 16:29
wp_remote_post.php () example
$endpoint = 'api.example.com';
$body = [
'name' => 'Pixelbart',
'email' => 'pixelbart@example.com',
];
$body = wp_json_encode( $body );
$options = [
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
;(function ($) {
"use strict";
jQuery(document).ready(function($) {
/*----------------------------------
magnific popup activation
----------------------------------*/
$('.image-popup').magnificPopup({
type: 'image'
@Sharifur
Sharifur / wp-query.php
Created March 26, 2020 07:15
WP_Query Arguments list
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
@Sharifur
Sharifur / elementor-repeater-control-condition.php
Last active November 25, 2021 07:03
how to use condition inside elementor repeater controls, elementor repeater condition
$this->add_control( 'testimonial_items', [
'label' => esc_html__( 'Testimonial Item', 'appside-master' ),
'type' => Controls_Manager::REPEATER,
'default' => [
[
'designation' => esc_html__( 'Technician', 'appside-master' ),
],
],
'fields' => [
@Sharifur
Sharifur / custom-permalink-from-meta.php
Created March 16, 2020 07:41 — forked from petenelson/custom-permalink-from-meta.php
WordPress permalink for custom post type based on post meta
@Sharifur
Sharifur / add-custom-icon-to-elementor-new-controls-icons.php
Created March 12, 2020 15:54
add custom add on to elementor new controls icons
add_filter('elementor/icons_manager/native',array($this,'add_custom_icon_to_elementor_icons'));
public function add_custom_icon_to_elementor_icons($icons){
$icons['la-line'] = [
'name' => 'la-line',
'label' => __( 'Line Awesome - Accessibility', 'elementor' ),
'url' => XGENIOUS_MASTER_CSS .'/line-awesome.min.css', // icon css file
'enqueue' => [XGENIOUS_MASTER_CSS .'/line-awesome.min.css'], // icon css file
'prefix' => 'la-', prefix ( like fas-fa )
@Sharifur
Sharifur / proc_open-solve.php
Created March 6, 2020 08:46
Process class relies on proc_open, which is not available on your PHP installation.
It is because of Flare error reporting service enabled in debug mode
There is a workaround for this.
Publish flare config file
php artisan vendor:publish --tag=flare-config
and in config/flare.php
Set
<?php
$big = 999999999;
$pagination_args = array(
'base' => str_replace('%_%', 1 == $paged ? '' : "?page=%#%", "?page=%#%"),
'format' => '?page=%#%',
'total' => $all_downloads->max_num_pages,
'current' => max( 1, $paged ),
'show_all' => false,
'prev_text' => '<i class="fa fa-angle-double-left"></i>',
'next_text' => '<i class="fa fa-angle-double-right"></i>',