Skip to content

Instantly share code, notes, and snippets.

View NilsDannemann's full-sized avatar

Nils Dannemann NilsDannemann

View GitHub Profile
@NilsDannemann
NilsDannemann / functions.php
Created April 4, 2017 17:37
Functions.php with broken (?) comment-form
<?php
/**
* BP-Default theme functions and definitions
*
* Sets up the theme and provides some helper functions. Some helper functions
* are used in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress and BuddyPress to change core functionality.
*
* The first function, bp_dtheme_setup(), sets up the theme by registering support
* for various features in WordPress, such as post thumbnails and navigation menus, and
@NilsDannemann
NilsDannemann / comment-template.php
Created April 4, 2017 17:41
Comment-Template.php with broken (?) comment-form
<?php
/**
* Comment template functions
*
* These functions are meant to live inside of the WordPress loop.
*
* @package WordPress
* @subpackage Template
*/
@NilsDannemann
NilsDannemann / comments.php
Created April 4, 2017 17:43
Comments.php with broken (?) Comment Form
<?php
if ( post_password_required() ) {
echo '<h3 class="comments-header">' . __( 'Password Protected', 'buddypress' ) . '</h3>';
echo '<p class="alert password-protected">' . __( 'Enter the password to view comments.', 'buddypress' ) . '</p>';
return;
}
if ( is_page() && !have_comments() && !comments_open() && !pings_open() )
return;
@NilsDannemann
NilsDannemann / functions.php
Created December 14, 2017 09:53
Quick functions.php dump
<?php
/**
* BP-Default theme functions and definitions
*
* Sets up the theme and provides some helper functions. Some helper functions
* are used in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress and BuddyPress to change core functionality.
*
* The first function, bp_dtheme_setup(), sets up the theme by registering support
* for various features in WordPress, such as post thumbnails and navigation menus, and
@NilsDannemann
NilsDannemann / gist:4689d01ed5fcac1bac4279bde746c7fe
Last active December 10, 2020 11:01
PHP - Shortcode - JetEngine no Image Fallback
<?php
/**
*
* Shortcode: JetEngine no image fallback
*
*/
function jetengine_img_handler( $atts, $content = null ) {
extract(shortcode_atts(array(
'src' => ''
), $atts));
@NilsDannemann
NilsDannemann / .gitignore
Created March 19, 2021 14:22
wp gitignore
# ignore everything in the root except the "wp-content" directory.
!wp-content/
# ignore everything in the "wp-content" directory, except:
# "mu-plugins", "plugins", "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@NilsDannemann
NilsDannemann / script.js
Last active October 3, 2021 06:43
Trigger Plutio Chat on Button Click
<script>
//Button Code: <button class="plutio-open-chat">Open Chat</div>
//Find all Chat Buttons on the Page
var plutioChatButtons = document.querySelectorAll('.plutio-open-chat');
//Trigger Open-Chat when one of them is clicked
for (var i = 0; i < plutioChatButtons.length; i++) {
plutioChatButtons[i].addEventListener('click', function() {
event.preventDefault();
$plutio_msg.open();
display.user OR display.progress
// if not: not visible
access.user
// if not: you must buy this
access.progress
// if not: you must learn more
http://localhost:3000/api/v1/sections/
// -> state: down
// -> ✅ permissions: included (for sections)
http://localhost:3000/api/v1/sections/section1
// -> state: running (but some sections missing)
// -> ✅ permissions: included (for sections)
http://localhost:3000/api/v1/sections/section1/?getUnits=true
// -> ✅ state: running
// -> ✅ permissions: included (for units)
// -> ✅ blocks: included