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 | |
add_action( 'wp_head', 'add_product_info_to_head' ); | |
function add_product_info_to_head() { | |
global $product; | |
if ( is_product() ) { | |
$image = wp_get_attachment_image_url( $product->get_image_id(), 'full', false ); | |
echo '<script type="application/ld+json"> | |
{ |
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
<template> | |
<span :title="humanFriendlyDate">{{ diffForHumans }}</span> | |
</template> | |
<script> | |
import dayjs from "dayjs"; | |
import relativeTime from "dayjs/plugin/relativeTime"; | |
import localizedDate from "dayjs/plugin/localizedFormat"; | |
import tr from "dayjs/locale/tr"; | |
dayjs.extend(relativeTime); |
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 | |
$fa5all = array( | |
'fas fa-ad', | |
'fas fa-address-book', | |
'fas fa-address-card', | |
'fas fa-adjust', | |
'fas fa-air-freshener', | |
'fas fa-align-center', | |
'fas fa-align-justify', |
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 | |
// Please use this function carefully. | |
// Changes can't undone. Best regards from Serkan Algur :) | |
// Let the function begin | |
function delete_oldest_posts_salgur( ) { | |
// We will collect posts from two years ago :) | |
$args = array( | |
'date_query' => array( | |
array( | |
'column' => 'post_date_gmt', |
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 | |
/** Random Color Part Generator HEX **/ | |
function RandomColorPart() | |
{ | |
return mt_rand(0, 255); | |
} | |
/** Random Color Part Generator **/ |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/serkanalgur/phpfuncs" | |
) | |
func main(){ |
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 | |
/** | |
* Yazı Adı : Geçmiş Yazıları ve Ortam Dosyalarını Otomatik Silmek | |
* Yazı Linki : https://wpadami.com/cms-sistemleri/wordpress/gecmis-yazilari-ortam-dosyalarini-otomatik-silmek.html. | |
**/ | |
// Kodu lütfen dikkatli kullanın. Saygılarımla, Serkan Algur :) | |
// Kod başlasın | |
function delete_oldest_posts_salgur() |
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 | |
/** | |
* Yazı İsmi : 30 Günden Eski Mesajlarınıza Yorum Yapılmasını Engellemek | |
* Yazı Linki : https://wpadami.com/cms-sistemleri/wordpress/30-gunden-eski-mesajlariniza-yorum-yapilmasini-engellemek.html | |
*/ | |
function close_comments($posts) | |
{ | |
if (!is_single()) { |
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
DELIMITER $$ | |
CREATE FUNCTION `json_extract`(`details` TEXT, `required_field` VARCHAR(255)) RETURNS text CHARSET utf8mb4 | |
BEGIN | |
RETURN TRIM( | |
BOTH '"' FROM SUBSTRING_INDEX( | |
SUBSTRING_INDEX( | |
SUBSTRING_INDEX( | |
details, | |
CONCAT( | |
'"', |
NewerOlder