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 | |
if ( !class_exists( 'VATMessage' ) ) { | |
class VATMessage { | |
function activate() { | |
add_filter( 'woocommerce_get_price_html', array( $this, 'vat_message' ) ); | |
} | |
function vat_message( $price ) { | |
$vat = ' <span class="vat-info">' . __( '(VAT not included)', 'logopedicum' ) . '</span>'; |
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 | |
if ( !class_exists( 'wcShippingBigProducts' ) ) { | |
class wcShippingBigProducts { | |
// disable free sipping if "big products" in cart | |
// "big products" has shipping class 'productos-grandes' | |
function activate() { | |
add_filter( 'woocommerce_package_rates', array( $this, 'shippingBigProducts' ), 10, 2 ); | |
} |
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 | |
if ( ! defined( 'WPINC' ) ) { | |
die; | |
} | |
if ( !class_exists( 'HideShipmentsIfFree' ) ) { | |
class HideShipmentsIfFree { | |
function activate() { | |
add_action( 'woocommerce_package_rates', array( $this, 'hide_shipments_if_free' ), 100 ); |
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
<form action="<? bloginfo('url'); ?>" method="get"> | |
<select name="page_id" id="page_id"> | |
<?php | |
global $post; | |
$args = array( 'numberposts' => -1); | |
$posts = get_posts($args); | |
foreach( $posts as $post ) : setup_postdata($post); ?> | |
<option value="<? echo $post->ID; ?>"><?php the_title(); ?></option> | |
<?php endforeach; ?> | |
</select> |
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
private final String LOG_TAG = MyClass.class.getSimpleName(); | |
//... | |
Log.e(LOG_TAG, "Error ", e); |
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
<activity | |
android:name=".MainActivity" | |
android:label="@string/app_name" | |
android:screenOrientation="portrait" | |
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> |
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
@Override | |
public void onClick(View v) { | |
if ( v instanceof Button ){ | |
String btnText = ((Button) v).getText().toString(); | |
}else if ( v instanceof ListView ) { | |
// .. | |
} //.. | |
} |
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
//Create an object of the Random class so we can use it | |
Random randInt = new Random(); | |
//Generate a random number between 0 and 5 | |
int randNum = randInt.nextInt(6); |
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 wpr_active_site_plugins() { | |
$the_plugs = get_option('active_plugins'); | |
foreach($the_plugs as $key => $value) { | |
$string = explode('/',$value); // Folder name will be displayed | |
echo $string[0] ."\n"; | |
} | |
} | |
wpr_active_site_plugins(); |
NewerOlder