Skip to content

Instantly share code, notes, and snippets.

@bilalmalkoc
bilalmalkoc / disable-elementor-frontend-scripts.php
Last active February 19, 2023 15:39
Disable Elementor frontend scripts.
// Disable Elementor frontend scripts on frontedn.
function _my_theme_remove_plugin_scripts() {
if ( is_admin() ) {
return;
}
wp_dequeue_script( 'swiper' );
wp_dequeue_style( 'swiper' );
wp_deregister_script( 'swiper' );
<?php echo esc_html( get_post_meta( get_the_ID(), '_spp_count', true ) ); ?>
require get_template_directory() . '/inc/postViews.php';
/*
Plugin Name: Simple Popular Posts Lite
Plugin URI: -
Description: -
Version: 2014.10.16
Author: khromov
Author URI: http://snippets.khromov.se
License: GPL2
*/
// Bu kod gayet akıllıca ve kısa. Fakat düzgün anlaşılmıyor.
isset( $var ) || $var = some_function();
// Bu daha iyi ve anlaşılır.
if ( ! isset( $var ) ) {
$var = some_function();
}
// Yanlış kullanım
if ( $data = $wpdb->get_var( '...' ) ) {
// Doğru kullanım
if( true === $variable ) {
...
}
// Yanlış kullanım
if( $variable == true ) {
...
}
// Yanlış kullanım
function eat( $what, $slowly = true ) {
...
}
// Doğru kullanım
function eat( $what, $speed = 'slowly' ) {
...
}
define( 'DOING_AJAX', true );
define( 'TEST_DENEME_DEGISKENI', 'test' );
class Walker_Category extends Walker { [...] }
class WP_HTTP { [...] }
// Doğru kullanım
function test_fonksiyon_ismi( $test_degisken_ismi ) { ... }
// Yanlış kullanım
function testFonksiyonIsmi( $testDegiskenIsmi ) { ... }