Skip to content

Instantly share code, notes, and snippets.

@wpdevsol
wpdevsol / wordmove-cheat-sheet.sh
Created August 12, 2022 10:01 — forked from thetwopct/wordmove-cheat-sheet.sh
Wordmove CLI Cheat Sheet
# Pull from WP Engine project - including Uploads
wordmove pull --all --no-mu-plugins
# Pull from WP Engine project - excluding Uploads
wordmove pull --all --no-mu-plugins --no-uploads
# Pull from server when you will use Rsync for DB
wordmove pull --all --no-db
#more to come
@wpdevsol
wpdevsol / image_upload.php
Created August 12, 2022 09:58 — forked from mahamudul310/image_upload.php
How to upload image in oop
=============================FONTEND FORM===============================
<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
<input type="file" name="image" accept="image/*" multiple />
===========================BACKEND================================
if(isset($_POST['save'])){
$message = $blog->save_image_info($_POST);
}
$query_result = $blog->selectAllimageinfo();
============================FUNCTION======================================
public function save_image_info() {
@wpdevsol
wpdevsol / cheatsheet.php
Created August 12, 2022 09:56 — forked from mahamudul310/cheatsheet.php
WordPress cheat sheet.
<?php wp_head(); ?> //Add end of header section.
<?php wp_footer(); ?> //Add end of footer section.
// Include style and escript in wordpress
<?php
if(! function_exists('hasan_theme_scripts')){
add_action('wp_enqueue_scripts','hasan_theme_scripts');
function hasan_theme_scripts(){
wp_enqueue_style('bootstrap', get_template_directory_uri().'/css/bootstrap.min.css', array(),'1.0.0','all');

WordPress Filters Cheat Sheet

This cheat sheet explores a fundamental concept in WordPress development: filters.

In WordPress, filters enable developers to intercept and modify data as a WordPress page is loading, before sending it to the browser or saving it to the database.

Understanding how filters work isn’t all that easy, partly because the concept is difficult to visualize, and also because filters are often confused with WordPress actions. Yet, it’s an important concept to master because filters are one of the most common ways developers interact with WordPress.

For these reasons, this filter cheat sheet is ideal for those new to working with filters. This cheat sheet provides an in-depth understanding of what filters do and how they work, and provides a quick reference guide for using filters in WordPress development.

@wpdevsol
wpdevsol / Wordpress Snippets
Created August 12, 2022 09:29 — forked from devonmather/Wordpress Snippets
Various common Wordpress Snippets
<?php // Load in WP functions outside of wordpress
define('WP_USE_THEMES', false);
require('/home/kindyhub/public_html/wp-blog-header.php'); ?>
add_action('wp_enqueue_scripts', 'no_more_jquery');
function no_more_jquery(){
//if(!is_bbpress()) { //sample condition inside function
wp_deregister_script('jquery');
//}
}

###Custom Post Types

Docs

function codex_custom_init() {
  $labels = array(
    'name'               => 'Books',
    'singular_name'      => 'Book',
    'add_new'            => 'Add New',
@wpdevsol
wpdevsol / functions.php
Created August 12, 2022 09:01 — forked from taniarascia/functions.php
Inlcuding custom fields and uploads in a WordPress post
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,