Skip to content

Instantly share code, notes, and snippets.

View trueqap's full-sized avatar
🎯
Focusing

TrueQAP trueqap

🎯
Focusing
View GitHub Profile
@trueqap
trueqap / potkulcs.php
Created February 2, 2024 10:32
potkulcs.php
<?php
//Részletek itt: https://wphu.org/tippek-trukkok/hogyan-jussunk-wordpress-adminba-hozzaferes-nelkul/
require_once 'wp-blog-header.php';
require_once 'wp-includes/registration.php';
$newusername = 'hellowp2022';
$newemail = 'website2022@hellowp.io';
<?php
/**
* Plugin Name: Custom Shipping Estimate for WooCommerce
* Description: Adds a shipping estimate notice on WooCommerce product pages.
* Version: 1.0
* Author: trueqap
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@trueqap
trueqap / wp_fc_campaign_emails.sql
Created November 9, 2023 07:39
wp_fc_campaign_emails.sql
--
-- Table structure for table `wp_fc_campaign_emails`
--
CREATE TABLE `wp_fc_campaign_emails` (
`id` bigint(20) UNSIGNED NOT NULL,
`campaign_id` bigint(20) UNSIGNED DEFAULT NULL,
`email_type` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT 'campaign',
`subscriber_id` bigint(20) UNSIGNED DEFAULT NULL,
`email_subject_id` bigint(20) UNSIGNED DEFAULT NULL,
@trueqap
trueqap / functions.php
Created May 10, 2023 13:35
WordPress Bootstrap Pagination
<?php
class BootstrapPagination {
public static function render() {
global $wp_query;
$current = max(1, absint(get_query_var('paged')));
$pagination = paginate_links(array(
'base' => str_replace(PHP_INT_MAX, '%#%', esc_url(get_pagenum_link(PHP_INT_MAX))),
'format' => '?paged=%#%',
'current' => $current,
@trueqap
trueqap / functions.php
Created February 7, 2023 06:59
eazydocs-pro fix: eazydocs-pro/includes/functions.php
<?php
/* PLS
function get_post_by_slug($post_slug) {
global $wpdb;
$post_slug = '%' . $post_slug . '%';
$post = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts LEFT JOIN wp_term_relationships ON wp_posts.ID = wp_term_relationships.object_id WHERE post_name LIKE %s ", $post_slug));
return $post;
}
@trueqap
trueqap / single.php
Created January 31, 2023 16:51
single.php
<?php
$ACF_mezo_neve = "ide";
if( !empty(get_post_meta(get_the_ID(), $ACF_mezo_neve, true)) ){
echo '<h4 class="kapcsolodo-fajlok">Kapcsolódó fájlok:</h4>';
}
@trueqap
trueqap / php.ini
Created January 18, 2023 06:47
Elementor ajánlott tárhelybeállítások
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
php_value max_input_vars 10000
php_value memory_limit 1024M
@trueqap
trueqap / dumprequest.php
Created April 22, 2022 14:16 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
<?php
foreach ($billing_fields as $field_key => $field) {
if (! in_array($field_key, (array) $billing_all_fields, true)) {
continue;
}
$function_name = 'get_' . $field_key;
if ($order->get_meta('_' . $field_key)) {
@trueqap
trueqap / die-jetwoo.php
Last active February 11, 2022 21:25
wp-content/mu-plugins/die-jetwoo.php
<?php
/**
* jetwoodie_plugins_affected_by function
*
* @param [type] $rules
* @return void
*/
function jetwoodie_plugins_affected_by($rules)
{
$affected = array();