Skip to content

Instantly share code, notes, and snippets.

View electroidru's full-sized avatar

electroidru

  • electroid.lab
View GitHub Profile
@anoriar
anoriar / AuthorTable.php
Created July 16, 2018 13:46
Сущности многие ко многим: Книги Авторы, сложный запрос: перечисление авторов каждой книги
namespace Orm;
use Bitrix\Main\Entity;
class AuthorTable extends Entity\DataManager{
public static function getTableName()
{
return 'author';
}
@mcguffin
mcguffin / acf-get-field-key.php
Last active June 13, 2023 13:32
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.