Bin e padrões para validação de cartão de crédito.
| Bandeira | Começa com | Máximo de número | Máximo de número cvc |
|---|---|---|---|
| Visa | 4 | 13,16 | 3 |
| Mastercard | 5 | 16 | 3 |
| <?php | |
| /** A simple text block **/ | |
| if(!class_exists('AQ_Portfolio_Block')) { | |
| class AQ_Portfolio_Block extends AQ_Block { | |
| //set and create block | |
| function __construct() { | |
| $block_options = array( | |
| 'name' => 'Portfolio', |
| <?php | |
| /** | |
| * Use the built-in post counter | |
| * | |
| * Sometimes you'll want to keep track of which post you're on in a loop. | |
| * Some people create their own $loop_counter (ex: Genesis, https://gist.github.com/4675237 ). | |
| * There's a better way! A loop counter is built into $wp_query. Ex: | |
| * | |
| * global $wp_query; | |
| * echo $wp_query->current_post |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( |
| function custom_taxonomies_terms_links() { | |
| global $post, $post_id; | |
| // get post by post id | |
| $post = &get_post($post->ID); | |
| // get post type by post | |
| $post_type = $post->post_type; | |
| // get post type taxonomies | |
| $taxonomies = get_object_taxonomies($post_type); | |
| $out = "<ul>"; | |
| foreach ($taxonomies as $taxonomy) { |
| <?php | |
| /** | |
| * Limit previous/next post title character length and append a ellipsis if trunicated | |
| */ | |
| $previous_post = get_adjacent_post( false, '', true ); | |
| $next_post = get_adjacent_post( false, '', false ); | |
| $previous_post_title= get_the_title($previous_post); | |
| $next_post_title = get_the_title($next_post); | |
| $max_length = 75; | |
| $previous_post_length = strlen($previous_post_title); |
| <?php | |
| function basic_wp_seo() { | |
| global $page, $paged, $post; | |
| $default_keywords = 'wordpress, plugins, themes, design, dev, development, security, htaccess, apache, php, sql, html, css, jquery, javascript, tutorials'; // customize | |
| $output = ''; | |
| // description | |
| $seo_desc = get_post_meta($post->ID, 'mm_seo_desc', true); | |
| $description = get_bloginfo('description', 'display'); | |
| $pagedata = get_post($post->ID); |
| /** | |
| * Retrieve custom meta for use in the REST API | |
| * | |
| * @param array $object Details of current post. | |
| * @param string $field_name Name of field. | |
| * @param WP_REST_Request $request Current request | |
| * | |
| * @return mixed | |
| */ | |
| function prefix_get_custom_meta( $object, $field_name, $request ) { |
| //Register Meta with Rest API | |
| add_action( 'rest_api_init', 'prefix_register_custom_meta' ); | |
| function prefix_register_custom_meta() { | |
| register_rest_field( | |
| 'post', | |
| '_prefix_url', | |
| array( | |
| 'get_callback' => 'prefix_get_custom_meta', | |
| 'update_callback' => null, | |
| 'schema' => null, |