str.replaceAll("^(\\d{4})-(\\d{2})-(\\d{2})$", "$3-$2-$1"));
str.replaceAll("^(\\d{2})-(\\d{2})-(\\d{4})$", "$3-$2-$1"));
String input = "Thu Jun 18 20:56:02 EDT 2009";
SimpleDateFormat parser = new SimpleDateFormat("EEE MMM d HH:mm:ss zzz yyyy");
Date date = parser.parse(input);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(date);
div.btn {
position: relative;
top: -50px;
left: calc( 50% - 50px );
width: 100px;
height: 100px;
border-radius: 50px;
background-color:red;
}
CREATE TABLE IF NOT EXISTS `ForgeRock` (
`id` int(11) DEFAULT NULL,
`site` varchar(128) DEFAULT NULL,
`date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `ForgeRock` (`id`, `site`, `date`) VALUES
(1, 'site1.ru', '2016-02-13'),
(2, 'site1.ru', '2016-03-13'),
(3, 'site2.ru', '2016-02-13'),
(4, 'site2.ru', '2016-02-13'),
(5, 'site1.ru', '2016-02-13'),
(6, 'site2.ru', '2016-03-13'),
(7, 'site1.ru', '2016-02-13');
SELECT `date`, `site`, COUNT(`id`)
FROM ForgeRock
WHERE `site`= "site1.ru"
GROUP BY `date`
ORDER BY `date` DESC
@font-face {
font-family: 'Proxima Nova Regular';
font-weight: 400;
font-style: normal;
src: url('./assets/fonts/proxima-nova/proxima-nova-regular.eot');
src: url('./assets/fonts/proxima-nova/proxima-nova-regular.eot?#iefix') format('embedded-opentype'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.woff') format('woff'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.ttf') format('truetype'),
url('./assets/fonts/proxima-nova/proxima-nova-regular.otf') format('opentype');
}
add_filter( 'tiny_mce_before_init', 'mce_custom_fonts' );
function mce_custom_fonts( $init ) {
$theme_advanced_fonts = "Andale Mono=andale mono,times;" .
"Arial=arial,helvetica,sans-serif;" .
"Arial Black=arial black,avant garde;" .
"Book Antiqua=book antiqua,palatino;" .
"Comic Sans MS=comic sans ms,sans-serif;" .
"Courier New=courier new,courier;" .
"Georgia=georgia,palatino;" .
"Helvetica=helvetica;" .
"Impact=impact,chicago;" .
"Proxima Nova Regular=Proxima Nova Regular;" . /* <---------- This is my custom font */
"Symbol=symbol;" .
"Tahoma=tahoma,arial,helvetica,sans-serif;" .
"Terminal=terminal,monaco;" .
"Times New Roman=times new roman,times;" .
"Trebuchet MS=trebuchet ms,geneva;" .
"Verdana=verdana,geneva;" .
"Webdings=webdings;" .
"Wingdings=wingdings,zapf dingbats";
$init['font_formats'] = $theme_advanced_fonts;
return $init;
}
add_action('wp_insert_post', function ($post_id) {
if ( get_post_type($post_id) == 'my-post-type' ) {
add_post_meta($post_id, 'meta-description', '', true);
}
return true;
});