Skip to content

Instantly share code, notes, and snippets.

View aiiddqd's full-sized avatar
💻
Code is poetry...

Antony I aiiddqd

💻
Code is poetry...
View GitHub Profile
@aiiddqd
aiiddqd / telegram-wordpress-oembed-website.md
Last active March 13, 2026 05:59
How to Embed a Telegram Post on Your WordPress Site

How to Embed a Telegram Post on Your WordPress Site

In 2026, embedding a single Telegram post (from a public channel or group) into a WordPress site is straightforward. Telegram provides an official widget, and WordPress supports it natively via oEmbed or simple HTML. Here are the two best methods that work reliably today.

Method 1 – Official Telegram Widget (No Plugin Required)

This uses Telegram's built-in embed script – perfect for one-off posts.

Docs https://core.telegram.org/widgets/post

@aiiddqd
aiiddqd / wp-upload-image-from-url.php
Created April 17, 2022 08:44 — forked from RadGH/rs_upload_from_url.php
Upload an image to WordPress media gallery from URL
<?php
/**
* Retrieves an image from a URL and uploads it using ld_handle_upload_from_path. See that function for more details.
*
* Note: This function should also work for local file paths as well, but the implementation is slightly different than ld_handle_upload_from_path.
*
* @param $image_url
* @param int $attach_to_post
* @param bool|true $add_to_media
@aiiddqd
aiiddqd / get_post_by_meta.php
Created April 17, 2022 07:36 — forked from maketheboat/get_post_by_meta.php
WordPress / Get Post by Meta Value
<?php
/**
* Get Post object by post_meta query
*
* @use $post = get_post_by_meta( array( meta_key = 'page_name', 'meta_value = 'contact' ) )
* @since 1.0.4
* @return Object WP post object
*/
function get_post_by_meta( $args = array() )
@aiiddqd
aiiddqd / sochi.md
Last active June 3, 2021 09:19
Sochi links

Sochi (Russian: Со́чи, IPA: [ˈsotɕɪ] (About this soundlisten)) is the largest resort city in Russia. The city is situated on the Sochi River, along the Black Sea in Southern Russia, with a population of 443,562 residents,[11] up to 600,000 residents in the urban area. The city proper covers an area of 176.77 square kilometers (68.25 sq mi), while the Greater Sochi Area covers over 3,502 square kilometers (1,352 sq mi). Sochi stretches across 145 kilometers (90 mi), and is the longest city in Europe,[12] the fifth-largest city in the Southern Federal District, the second-largest city in Krasnodar Krai, and the sixth-largest city on the Black Sea.

Being a part of the Caucasian Riviera, it is one of the very few places in Russia with a subtropical climate, with warm to hot summers and mild to cool winters.

With the alpine and Nordic events held at the nearby ski resort of Rosa Khutor in Krasnaya Polyana, Sochi hosted the XXII Olympic Winter Games and XI Paralympic Winter Games in 2014, as well as the Formula 1

@aiiddqd
aiiddqd / plugin.php
Last active January 4, 2021 15:07
ET_Builder_Module_Type_PostBased
<?php
get_template_part( '/includes/builder/module/helpers/Overlay.php' );
class My_Builder_Module_Events extends ET_Builder_Module_Type_PostBased {
/**
* Track if the module is currently rendering to prevent unnecessary rendering and recursion.
*
* @var bool
*/
@aiiddqd
aiiddqd / .gitlab-ci.yml
Created December 16, 2020 07:25 — forked from khoipro/.gitlab-ci.yml
Deploy from GitLab to WPEngine (Tested)
stages:
- deploy_dev
- deploy_staging
- deploy_live
before_script:
- 'which ssh-agent || ( apk add --update openssh )'
- apk add --update bash
- apk add --update git
- eval $(ssh-agent -s)
@aiiddqd
aiiddqd / MultiWH.php
Last active March 17, 2021 17:11
Сниппет для реализации интеграции множества складов и остатков для МойСклад и магазина с WooCommerce, плагин WooMS
<?php
/**
* Plugin Name: WooMS Multi Warehouse
* Plugin URI: https://github.com/wpcraft-ru/wooms/issues/327
* Description: Добавляет механизм сохранения остатков по множеству складов в метаполя продукта
* Version: 1.1
*/
defined('ABSPATH') || exit; // Exit if accessed directly
@aiiddqd
aiiddqd / text.md
Created May 31, 2020 10:47
Копирайтинг: искусство интересных текстов

Введение в копирайтинг Копирайтинг (англ. copywriting, где copy — копия или текстовый материал, write — писать) — написание текста с целью рекламы или других форм маркетинга. Это тексты, которые стимулируют рост продаж или популяризируют товар, компанию, услугу, человека или идею.

Копирайтеры – люди, которые пишут текст с целью рекламы или других форм маркетинга. Например: слоганы, сценарии для ТВ- и радиороликов, event-мероприятий, рекламные статьи, нативные статьи и пр.

В английском языке слово «копирайтинг» является неологизмом и в словарях отсутствует.

@aiiddqd
aiiddqd / dd.php
Created May 17, 2020 07:20
data debug
if(!function_exists('dd')){
function dd($data, $admin_check = false){
if( ! isset($_GET['dd']) ){
return;
}
echo '<pre>';
var_dump($data);