This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Force Plugin Activation/Deactivation (except if WP_DEBUG is on) | |
Plugin URI: http://tri.be/ | |
Description: Make sure the required plugins are always active. | |
Version: 1.0 | |
Author: Modern Tribe, Inc. | |
Author URI: http://tri.be/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
Title: Owl link | |
Description: Link block | |
Category: formatting | |
Icon: admin-comments | |
Keywords: link links | |
Mode: edit | |
Align: left | |
PostTypes: page post | |
SupportsAlign: left right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
/** | |
* Block Name: Testimonial | |
* | |
* This is the template that displays the testimonial block. | |
*/ | |
#} | |
<blockquote id="testimonial-{{ block.id }}" class="testimonial"> | |
{{ fields.testimonial }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_acf_block_render_callback( $block ) { | |
$vars['block'] = $block; | |
$vars['fields'] = get_fields(); | |
Timber::render( '/template-parts/block/content-testimonial.twig', $vars ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('acf/init', 'my_acf_init'); | |
function my_acf_init() { | |
// sprawdzamy czy funkcja istnieje | |
if( function_exists('acf_register_block') ) { | |
// rejestrujemy blok | |
acf_register_block(array( | |
'name' => 'testimonial', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_content', 'strip_usless_shortcodes', 50 ); | |
function strip_usless_shortcodes( $content ) { | |
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches ); | |
$pattern = get_shortcode_regex( $matches[1] ); | |
$content = preg_replace_callback( "/$pattern/", 'strip_usless_shortcodes_callback', $content ); | |
$content = str_replace( '<p></p>', '', $content ); | |
return $content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="wrapper"> | |
<?php | |
$args = [ 'posts_per_page' => 3, 'post_type' => 'post' ]; | |
$posts = get_posts( $args ); | |
if ( $posts ) { | |
echo '<div id="posts">'; | |
foreach( $wpisy as $post ) { | |
$post = setup_postdata(); | |
echo '<p><a href="'. get_the_permalink().'">'.get_the_title().'</a></p>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Application | |
web/app/uploads/* | |
!web/app/uploads/.gitkeep | |
# WordPress | |
web/.htaccess | |
# Dotenv | |
.env.* | |
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo DB_NAME=${db_name} > .env | |
echo DB_USER=${dev_db_user} >> .env | |
echo DB_PASSWORD=${dev_db_password} >> .env | |
echo DB_HOST=${dev_db_host} >> .env | |
echo DB_PREFIX=${db_prefix} >> .env | |
echo WP_ENV=${wp_env} >> .env | |
echo WP_HOME=http:\/\/domena.pl >> .env | |
echo WP_SITEURL=http:\/\/domena.pl/wp >> .env | |
echo "AUTH_KEY=''" >> .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo DB_NAME=${db_name} > .env | |
echo DB_USER=${dev_db_user} >> .env | |
echo DB_PASSWORD=${dev_db_password} >> .env | |
echo DB_HOST=${dev_db_host} >> .env | |
echo DB_PREFIX=${db_prefix} >> .env | |
echo WP_ENV=${wp_env} >> .env | |
echo WP_HOME=http:\/\/${folder}.domena.pl >> .env | |
echo WP_SITEURL=http:\/\/${folder}.domena.pl/wp >> .env | |
echo "AUTH_KEY=''" >> .env |
NewerOlder