Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Mainul Hassan Main shamimmoeen

🏠
Working from home
View GitHub Profile
@shamimmoeen
shamimmoeen / Form.php
Created Sep 30, 2020
How to hide the comment form for a specific user instead of user role?
View Form.php
<?php
namespace wpdFormAttr;
use wpdFormAttr\FormConst\wpdFormConst;
use wpdFormAttr\Field\DefaultField\Captcha;
class Form {
public $wpdOptions;
@shamimmoeen
shamimmoeen / gist:391baf2fed118c7f9479afa8c1535d06
Created Apr 14, 2020 — forked from discordier/gist:ed4b9cba14652e7212f5
options for phpStorm @noinspection annotation
View gist:391baf2fed118c7f9479afa8c1535d06
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@shamimmoeen
shamimmoeen / MyEditorComponent.js
Last active Feb 25, 2020
Integrate gutenberg editor in wordpress plugin's settings page
View MyEditorComponent.js
import {
BlockEditorKeyboardShortcuts,
BlockEditorProvider,
BlockInspector,
BlockList,
ObserveTyping,
SETTINGS_DEFAULTS,
WritingFlow,
} from '@wordpress/block-editor';
import { registerCoreBlocks } from '@wordpress/block-library';
@shamimmoeen
shamimmoeen / replace-parent-element-value-from-child-arrays.php
Created Sep 21, 2018
In multidimensional array replace parent element value from child arrays
View replace-parent-element-value-from-child-arrays.php
<?php
/**
* Stackoverflow link https://stackoverflow.com/questions/52388607/in-multidimensional-array-replace-parent-element-value-from-child-arrays
*/
$tree = array(
'16' => array(
'id' => '16',
'name' => 'Clothing',
@shamimmoeen
shamimmoeen / custom-file-upload-form-in-wordpress.php
Last active Oct 5, 2020
Create custom file upload form in WordPress
View custom-file-upload-form-in-wordpress.php
<?php
if ( ! function_exists( 'wpcfu_output_file_upload_form' ) ) {
/**
* Output the form.
*
* @param array $atts User defined attributes in shortcode tag
*/
function wpcfu_output_file_upload_form( $atts ) {
@shamimmoeen
shamimmoeen / load-wpjm-templates-via-hook.php
Last active Jun 20, 2018
Load WP Job Manager templates from theme/plugin using hook
View load-wpjm-templates-via-hook.php
<?php
add_action( 'job_manager_locate_template', 'my_theme_include_job_manager_templates', 10, 3 );
if (!function_exists('my_theme_include_job_manager_templates')) {
/**
* Include modified job manager templates.
*
* @param mixed $template The template
* @param string $template_name The template name
You can’t perform that action at this time.