Skip to content

Instantly share code, notes, and snippets.

@BoDonkey
BoDonkey / functions.php
Last active March 7, 2019 11:29
Remove the 'Divi' post status
/**
* Remove 'Divi' from post states.
*
* @param array $post_states Existing post states.
* @param object $post Current post object.
*
* @return array
*/
function divi_removal_filter( $post_states, $post ){
// Make sure that $post_states is an array. Third party plugin might modify $post_states and makes it null which can create issues
  1. Add class always-visitable to parent items you want to be visitable;

  2. Add this js code after the row if ( $(this).is(top_level_link) ) { :

if ($(this).parent().hasClass('always-visitable')) {
  $('<a class="hover-link"></div>')
    .attr('href', $(this).attr('href'))
    .on('click', function(e){ e.stopPropagation(); })
 .appendTo($(this));
@lots0logs
lots0logs / child-functions-php-snippet.php
Last active March 13, 2020 18:38
WordPress :: Divi Builder :: Contact Form Module :: Change the submit button text
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ---------------------------------------------------------------------- */
function my_et_theme_setup() {
if ( class_exists( 'ET_Builder_Module_Contact_Form' ) ) {
get_template_part( 'my-main-modules' );
$et_pb_contact = new My_ET_Builder_Module_Contact_Form();
remove_shortcode('et_pb_contact');
@mattclements
mattclements / function.php
Last active May 15, 2025 08:56
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@jesseeproductions
jesseeproductions / tec-change-wording-events-venues-organizers
Last active October 23, 2017 00:26
The Events Calendar - Change the Event/Events, Venue/Venues, and Organizer/Organizers
/**
* The Events Calendar - Change the Event/Events
*
* Add to a theme's functions.php or through a custom plugin
*
* Does not change the slug to change that change this setting: "Events URL slug" and this setting "Single event URL slug"
* Setting is on Events > Settings > General Tab
* @since 3.10
*/
add_filter( 'tribe_event_label_singular', 'tec_change_event_label' );