Skip to content

Instantly share code, notes, and snippets.

View krystyna93's full-sized avatar
🏠
Working from home

krystyna krystyna93

🏠
Working from home
  • Victoria, Australia
View GitHub Profile
@dlxsnippets
dlxsnippets / fullscreen-wp-admin.php
Created August 24, 2023 08:43
Demonstration of Creating a Fullscreen Admin
<?php
/**
* Plugin Name: Fullscreen Admin Panel.
* Plugin URI: https://dlxplugins.com
* Description: A demo plugin to create a fullscreen admin panel.
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 7.3
* Author: DLX Plugins
* Author URI: https://dlxplugins.com
@Mamikonars
Mamikonars / customizer.php
Created August 17, 2022 14:36
Customizer settings
<?php
function gym_castomization($wp_customize) {
//add panel
$wp_customize->add_panel('gym_panel', array(
'priority' => 30,
'capability' => 'edit_theme_options',
'title' => esc_html__('Gym settings', 'gym'),
'description' => esc_html__('Page settings', 'gym'),
));
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:06
Add featured image column to WP admin panel - posts AND pages
<?php
/**
* Add featured image column to WP admin panel - posts AND pages
* See: https://bloggerpilot.com/featured-image-admin/
*/
// Set thumbnail size
add_image_size( 'j0e_admin-featured-image', 60, 60, false );
// What were searching for
$args = array(
'post_type' => $post_type,
'post_status' => 'publish'
);
// Now, if the category has been selected AND it doesn't equal the "show all" value
if(isset($_POST['category']) && $_POST['category'] != -1) {
// Explode the string into an array
$categories = array_map('intval', explode(',', $_POST['category']));
@zackpyle
zackpyle / *Best Snippets*
Last active May 1, 2024 20:05
Best PHP/JS Snippets
This is a collection of my most used or most useful PHP and JS snippets
**Disclaimer, I didn't write most of these - I just curated them over the years**
@Matteo182
Matteo182 / user_profile.php
Created April 3, 2020 17:36
Front_end profile page in WordPress
<?php
/**
* The template for displaying user profile in front_end
*
* This is the template that displays user profile in fron_end.
*
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
@MelMacaluso
MelMacaluso / expose_ACF_fields_to_REST.php
Created June 4, 2019 22:54
Automatically expose all the ACF fields to the Wordpress REST API in Pages and in your custom post types.
<?php
function create_ACF_meta_in_REST() {
$postypes_to_exclude = ['acf-field-group','acf-field'];
$extra_postypes_to_include = ["page"];
$post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exclude);
array_push($post_types, $extra_postypes_to_include);
foreach ($post_types as $post_type) {
register_rest_field( $post_type, 'ACF', [
<?php
add_action( 'init', 'my_theme_custom_post' );
function my_theme_custom_post() {
register_post_type( 'agent',
array(
'labels' => array(
'name' => __( 'Agents' ),

"Knowledge is powerful, be careful how you use it!"

A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools, and more.