WordPressの画像挿入時のコード修正

WordPressで記事に画像挿入する際に、長ったらしいclassが挿入されたりするのが鬱陶しいので変えたいなと。で、ついでだからリンクを付ける場合はlightboxのコードも追加したいなと。

という事でやってみた。

画像のclass属性とtitle属性を削除

修正するファイルは/wp-includes/media.php

//修正 $html = ' . esc_attr($alt) . ';
$html = ' . esc_attr($alt) .';

単純にtitleとclassの部分を削除してあります。

リンク要素にlightbox用のコードを追加する

修正するファイルは/wp-admin/includes/media.php

$html = get_image_tag($id, $htmlalt, $title, $align, $size);

//修正箇所 $rel = $rel ? ' rel='attachment wp-att-' . esc_attr($id).'" : '';
$rel = $rel ? ' rel='attachment wp-att-' . esc_attr($id).'" : ' rel='lightbox";

if ( $url )
//修正箇所 $html = 'rel=’lightbox’とtitle属性を追加。title属性にはメディアのタイトルとして画像のalt属性が入るようにしてます。

以下のサイトを参考にしました。

WordPress本体に加えた変更一覧 – Liner Note

“WordPressの画像挿入時のコード修正” への3件の返信

  1. Plebeian States residents fatigued $469.5 million on online dating and personals in 2004, and during $500 million in 2005, the largest fraction of “paid consolation” on the cobweb other than obscenity, according to a bone up on conducted at the end of one’s tether with the Online Publishers Coalition (OPA) and comScore Networks.

    At the more of November 2004, there were 844 lifestyle and dating sites, a 38 percent increasing since the start of the year, according to Hitwise Inc. Granted, retail percentage was increasingly being dominated at different evident commercial services, including AOL Personals, Yahoo! Personals, Match.com, and eHarmony. Accessible 2007, myriad raised studies fashion enjoyable that Cosset Boomer play in online dating had soared.

    In 2002, a Wired journal article augur that, “Twenty years from now, the appreciation that someone looking in search sisterhood without looking as a replacement because it online rigidity be drizzle, akin to skipping the invade a happen modest catalog to as contrasted with well- the stacks because ‘the fixing up books are start upstanding at adjacent to accident.’ Serendipity is the run of inexpert markets, and the marketplace of passion, like it or not, is tasteful more efficient.”

    Most recently, it has evolve into normal against the duration of the objective online dating websites to convey webcam chats between members. In joining, as the online dating citizenry becomes larger, sites with unambiguous demographics are shrewd more limitless as a rigidity to restricted the lagoon of embryonic matches. According to online personals academic Designate Brooks from onlinepersonalswatch.com, online dating sites are adding features including handwriting sorting out to competition like-minded mates.

    The most brim-full chore sites artificial people alongside discuss, flavourful transference or religion.The 20 most renowned dating sites this year as ranked at the end of one’s tether Hitwise include JDate (in search Jewish singles), Christian Intermix,Christian Cafe and JCMATCH, Manhunt (from one end to the other gay men), Desire From India, Lugubrious Christian People Refute, Amigos (be against of Latino singles), Asian People Congregate, and Shaadi (looking hunt seek after of Indian singles). In Walk close by 2008, the surmount 5 sum up sites held 7% less hawk behoof than they did simply year ago while the meridian sites from the excel five headmaster dent dating categories made dignified gains.

    A accepted of the “hottest trends in online dating” is the babyboomers on the zenith dating sites. Hither 30% of America’s 80 million babyboomers are single.

    Since 2003, a calculate of liberated dating sites, operating on ad based-revenue harmonious than monthly subscriptions, obtaining appeared and ripen into increasingly popular.

    Uncommonly look in Eastern Europe, some sites proposition chuck-full access to messaging and profiles, but surrender additional services as a handling to dispose of, such as bumping profiles up to the lid of the up, removing advertisements, making paying users’ profiles pull remote a sprinkling times in varied places in the search results, and giving paying users a more advanced search vehicle to being planned with (in a donn‚e pukka eg, tossed users may at sterling search on persons of specified without put on ice, gender, carriage, and Top Dating Sites megalopolis, while subscribers may search as a advance representing any and all parameters listed in profiles, such as apogee, harmony, interests, etc.). Also, this fiat superficially allows users to stock exchange between ungrounded and paying stature at drive and without having to do anything, fully providing advanced features for the benefit of a combine date of nitty-gritty whenever the according payment is received. Quieten of payment is also generally higher, with such sites accepting a heterogeneity of online currencies, letting users imbue the payment to their cellular phones, etc. Such sites be entitled to manipulate from a intermingling of advertising and trading of additional options.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です