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
import { registerFormatType, applyFormat, toggleFormat } from '@wordpress/rich-text'; | |
import { useSelect } from '@wordpress/data'; | |
import { BlockControls, MediaUpload, MediaUploadCheck } from '@wordpress/block-editor'; | |
import { Button, TextControl, ToolbarGroup, ToolbarButton, Modal, TextareaControl } from '@wordpress/components'; | |
import { useState } from '@wordpress/element'; | |
import { comment } from '@wordpress/icons'; | |
import { | |
Card, | |
CardHeader, | |
CardBody, |
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
import { get } from 'lodash'; | |
import { select, useSelect } from '@wordpress/data'; | |
const image = useSelect( () => select( 'core' ).getMedia( id ) ); | |
const thumbnail = get( image, [ 'media_details', 'sizes', 'medium', 'source_url' ] ); |
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
public function get_tax_by_term($use_var) { | |
if ( ! $this->all_terms ) { | |
$this->all_terms = get_transient('all_terms_' . $this->post_type ); | |
if ( ! $this->all_terms ) { | |
$taxonomy_names = get_object_taxonomies( $this->post_type ); | |
$this->all_terms = []; | |
foreach ( $taxonomy_names as $taxonomy_name ) { | |
$terms = get_terms( [ | |
'taxonomy' => $taxonomy_name, |
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
# Do not edit this file | |
# It will be overwritten each time nginx-rc upgrade | |
# Editing this file manually might break RunCloud System | |
# If you think there is a bug, contact us at bug@runcloud.io | |
worker_processes auto; | |
worker_rlimit_nofile 65535; | |
user runcloud-www runcloud-www; | |
pid /run/nginx-rc.pid; | |
pcre_jit on; |
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
################################################################################################### | |
# Rocket-Nginx | |
# | |
# Rocket-Nginx is a NGINX configuration to speedup your WordPress | |
# website with the cache plugin WP-Rocket (http://wp-rocket.me) | |
# | |
# Author: Maxime Jobin | |
# URL: https://github.com/maximejobin/rocket-nginx | |
# | |
# Tested with WP-Rocket version: 3.0.5.1 |
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 | |
// don't load directly | |
if (!defined('ABSPATH')) die('-1'); | |
class CreditznatokAddwiki | |
{ | |
private static $_instance; | |
static function getInstance() |
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
function move_term_to_top( $orderby, $query_vars, $taxonomies ) { | |
if ( 'my_taxonomy' === reset( $taxonomies ) ) { | |
$orderby = "(CASE WHEN t.name = 'My Top Term' THEN 1 ELSE t.name END)"; | |
} | |
return $orderby; | |
} | |
add_filter( 'get_terms_orderby', 'move_term_to_top', 10, 3 ); |
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
/** | |
* | |
* SVG upload fix for wp 4.7.1 | |
* | |
* @link https://wordpress.org/support/topic/wp-4-7-1-kills-svg/page/4/ | |
* | |
*/ | |
add_filter('wp_check_filetype_and_ext', 'ignore_upload_ext', 10, 4); | |
function ignore_upload_ext($checked, $file, $filename, $mimes) | |
{ |
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
add_filter('wp_check_filetype_and_ext', 'ignore_upload_ext', 10, 4); | |
function ignore_upload_ext($checked, $file, $filename, $mimes){ | |
//we only need to worry if WP failed the first pass | |
if(!$checked['type']){ | |
//rebuild the type info | |
$wp_filetype = wp_check_filetype( $filename, $mimes ); | |
$ext = $wp_filetype['ext']; | |
$type = $wp_filetype['type']; | |
$proper_filename = $filename; |
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
<!DOCTYPE html> | |
<html lang="ru-RU"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Вводное ДЗ по курсу PHP</title> | |
</head> | |
<body> | |
<?php |