For this guide, I'm using Eclipse Kepler
Add this to "Avalaible Software Sites":
- Egit: http://download.eclipse.org/egit/updates
- GitHub gists: http://dev.handwerkszeug.org/eclipse/3.6/org.handwerkszeug.update/
- GitHub Mylyn Connector:
| <?php | |
| // textdomain | |
| add_action( 'after_setup_theme', 'my_theme_setup' ); | |
| function my_theme_setup(){ | |
| load_theme_textdomain( 'my_textdomain', get_stylesheet_directory(). '/lang' ); | |
| } |
| <?php | |
| /** | |
| * | |
| * Translate product variations labels and names with filters | |
| * lgpd_translate_attributes_label | |
| * lgpd_translate_variation_option_name | |
| */ | |
| add_filter( 'woocommerce_variation_option_name', 'translate_variation_option_name' ); | |
| add_filter( 'woocommerce_attribute_label', 'translate_attributes_label' ); | |
| function translate_attributes_label( $result ){ |
| <?php | |
| /** | |
| * register scripts | |
| * | |
| */ | |
| add_action( 'init', 'lgpd_register_scripts' ); | |
| function lgpd_register_scripts(){ | |
| /* zebra datepickeer: http://stefangabos.ro/jquery/zebra-datepicker/ */ | |
| wp_register_script( 'js-zebra-datepicker', get_stylesheet_directory_uri() . '/inc/js/zebra_datepicker.js', array( 'jquery' ), '1.0' ); | |
| wp_register_script( 'js-lgpd', get_stylesheet_directory_uri() . '/inc/js/lgpd.js', array( 'jquery' ), '1.0' ); |
| <?php | |
| /** | |
| * modify search form | |
| * - "search for products" string translate | |
| * - language for qTranslate | |
| */ | |
| add_action( 'after_setup_theme', 'lgpd_change_search_nav' ); | |
| function lgpd_change_search_nav(){ | |
| remove_action('woo_nav_before', 'wootique_header_search'); | |
| add_action('woo_nav_before', 'lgpd_wootique_header_search'); |
| <?php | |
| /** | |
| * Function for show current cookies | |
| * @param string $paras | |
| * @param string $content | |
| * @return Ambigous <string, string, mixed> | |
| */ | |
| function lgpd_get_cookies( $paras = '', $content = '' ) { | |
| if ( strtolower( $paras[ 0 ] ) == 'novalue' ) { | |
| $novalue = true; |
| <?php | |
| /* | |
| * get post by slug | |
| */ | |
| function wp_get_post_by_slug( $slug, $post_type = 'post', $unique = true ){ | |
| $args=array( | |
| 'name' => $slug, | |
| 'post_type' => $post_type, | |
| 'post_status' => 'publish', | |
| 'posts_per_page' => 1 |
For this guide, I'm using Eclipse Kepler
Add this to "Avalaible Software Sites":
| public void sendMessage(View view) { | |
| Intent intent = new Intent(FirstActivity.this, SecondActivity.class); | |
| EditText editText = (EditText) findViewById(R.id.edit_message); | |
| String message = editText.getText().toString(); | |
| intent.putExtra(EXTRA_MESSAGE, message); | |
| startActivity(intent); | |
| } |
| // using finsih() | |
| Button closeButton = (Button) findViewById(R.id.bClose); | |
| closeButton.setOnClickListener(new OnClickListener() { | |
| @Override | |
| public void onClick(View v) { | |
| ActivityTwo.this.finish(); | |
| } | |
| }); |
| adb shell dumpsys package |