Add unfiltered_html to editor role

/** * Add the unfiltered_html capability to the editor role. * Be careful which users you grant this capability to. */ add_filter( ‘map_meta_cap’, function ( $caps, $cap, $user_id ) { // Change editor with the user role you want to…Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

Gravity Forms Submit Event

/** * Send a server-side event to the FB Conversions API when a Gravity Forms form is submitted using the Conversion Pixels addon. * * @param array $entry The entry data. * @param array $form The form data. */ add_action(…Continue reading

Replace all the URLs in the Schema with the current URL

add_filter( ‘aioseo_schema_output’, ‘aioseo_schema_change_urls’ ); function aioseo_schema_change_urls( $graphs ) { if ( false === strpos( $_SERVER[‘REQUEST_URI’], ‘home-search/listing/’ ) ) { return $graphs; } $request_uri = explode( ‘?’, $_SERVER[‘REQUEST_URI’] ); $uri = trim( ( $request_uri[0] ?? ” ), ‘/’ ); $old_url =…Continue reading

Beecee – My coach WpdataTables (SC_Coach_wpdatatable)

function FN_Coach_wpdatatable ( $atts ) { // Initialize user_id to empty $user_id = ”; // Get the user ID from dropdown list post form if (isset($_POST[‘action’]) && $_POST[‘action’] === ‘Beecee_GroupLeader_user_do’) { $user_id = intval($_POST[‘user-id’]); } // Check if $user_id is…Continue reading

Export Categories and Tags

function export_tags_and_categories() { $terms = get_terms( array( ‘category’, ‘post_tag’ ), array( ‘hide_empty’ => false ) ); $output = fopen( ‘php://output’, ‘w’ ); fputcsv( $output, array( ‘Term ID’, ‘Name’, ‘Slug’, ‘Description’, ‘Taxonomy’ ) ); foreach ( $terms as $term ) {…Continue reading