Skip to content

Instantly share code, notes, and snippets.

View AnadarProSvcs's full-sized avatar

Anadar Professional Services LLC AnadarProSvcs

  • Anadar Professional Servces LLC
View GitHub Profile
@AnadarProSvcs
AnadarProSvcs / disablexmlrpc.php
Created January 30, 2024 14:28
Disable XML-RPC in #WordPress
add_filter( 'xmlrpc_enabled', '__return_false' );
//Can be used as a route to being hacked, so if not needed, best to turn off.
@AnadarProSvcs
AnadarProSvcs / disable-wp-version.php
Created January 30, 2024 14:25
Hide Version Number in Front-End HTML in #WordPress
//WordPress version can help hackers target sites with known liabilities
add_filter('the_generator', '__return_empty_string');
@AnadarProSvcs
AnadarProSvcs / disable-admin-bar.php
Last active January 30, 2024 14:24
Disable Admin Bar in #WordPress
/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );
@AnadarProSvcs
AnadarProSvcs / svg-upload.php
Created January 30, 2024 14:23
Allow SVG Uploads in WordPress - Controlled by user role
/**
* Enable SVG file uploads for users with specific roles.
*
* @param array $upload_mimes Permitted mime types.
* @return mixed Updated list of mime types.
*/
add_filter(
'upload_mimes',
function ( $upload_mimes ) {
// Restrict SVG upload capability to users with certain roles for security reasons.
@AnadarProSvcs
AnadarProSvcs / mailerlite-subscribe.php
Created January 5, 2024 01:38
Add a user to the MailerLite email provider. This currently only adds, using the PHP SDK had issues when running in an older version of PHP.
function add_subscriber_to_mailerlite($email, $name) {
$apiKey = 'YOUR_MAILERLITE_API_KEY'; // Replace with your MailerLite API Key
$groupId = 'YOUR_GROUP_ID'; // Replace with your MailerLite Group ID if necessary
$url = 'https://api.mailerlite.com/api/v2/subscribers';
$data = array(
'email' => $email,
'name' => $name,
'groups' => array($groupId)
@AnadarProSvcs
AnadarProSvcs / PMPro_Member_Order.md
Created December 20, 2023 13:48
A breakdown of the Member_Order object properties and methods for Paid Memberships Pro #PMPro #pmpro

PMPro MemberOrder Object Reference

Overview

The MemberOrder object in Paid Memberships Pro is crucial for managing membership orders, payments, and related functionalities. It encompasses various properties and methods that facilitate effective handling of orders within the PMPro environment.

Properties

1. id

  • Type: Integer
  • Description: Unique identifier for the order.
@AnadarProSvcs
AnadarProSvcs / PMPro_email.md
Last active December 20, 2023 13:47
A breakdown of the Paid Memberships Pro Email Object #PMPro #pmpro

PMPro Email Object Reference

Overview

The PMPro Email object in Paid Memberships Pro is used for managing and sending emails within the PMPro system. It includes a variety of properties and methods that allow for customization and control over the email sending process.

Properties

1. email

  • Type: String
  • Description: The email address of the recipient.
@AnadarProSvcs
AnadarProSvcs / wp_term.md
Last active December 19, 2023 18:57
An over view of the WP_Term object from WordPress. WP_Term objects are often returned by functions like get_terms and get_term, and provide a convenient way to access the properties of individual terms. #wordpress

WordPress WP_Term Class Reference

Overview

WP_Term is a class in WordPress that represents terms within taxonomies such as categories, tags, or custom taxonomies.

Key Properties

  • term_id: The ID of the term.
  • name: The name of the term.
  • slug: The slug of the term, used in URLs.
  • term_group: The group that the term belongs to.
@AnadarProSvcs
AnadarProSvcs / wp_query.md
Last active December 19, 2023 18:56
WP_Query - An overview of the WP_Query in WordPress #wordpress

WordPress WP_Query Class Reference

Overview

WP_Query is a powerful class in WordPress used to query posts. It allows developers to specify a variety of parameters to retrieve posts, pages, custom post types, and more.

Key Properties

  • query: The query variables set in the new WP_Query instance.
  • query_vars: An array of query variables.
  • tax_query: The taxonomy query object.
  • meta_query: The meta query object.
@AnadarProSvcs
AnadarProSvcs / wp_user.md
Last active December 19, 2023 18:57
WP_User the WordPress User object common properties and functions #wordpress

WordPress WP_User Object Reference

Properties of WP_User

  • ID: Unique identifier for the user.
  • user_login: The user's login name.
  • user_pass: The user's password (hashed).
  • user_nicename: The URL-friendly user name.
  • user_email: The user's email address.
  • user_url: The user's website URL.